【8.0.34-0 ubuntu 安装Mysql 后无法链接是什么情况】

8.0.34-0 ubuntu 安装Mysql 后无法链接是什么情况

检查日志

如果检查一下帐号密码没问题看一下日志:

复制代码
Plugin mysql_native_password reported: ''mysql_native_password' is deprecated and will be removed in a future release. Please use caching_sha2_password instead'	

很显然是mysql 采用的密码插件出了问题:你采用了mysql废弃的密码验证方式:
Plugin mysql_native_password reported: 'mysql_native_password' is deprecated and will be removed in a future release. Please use caching_sha2_password instead

解决办法

这时候你可以通过SQL来更新认证模式和密码:

bash 复制代码
update user set plugin = 'caching_sha2_password' where user = '用户名';

操作之前先选择mysql库

对于PHP来说,使用7.1(7.1.16之前的版本)或者7.2(7.2.4之前的版本),仍需要将MySQL服务器的默认密码插件设置为mysql_native_password,不然无法正常连接到MySQL。

相关推荐
Ya-Jun3 小时前
常用第三方库:flutter_boost混合开发
android·flutter·ios
_一条咸鱼_4 小时前
深度剖析:Android NestedScrollView 惯性滑动原理大揭秘
android·面试·android jetpack
_一条咸鱼_4 小时前
深度揭秘!Android NestedScrollView 绘制原理全解析
android·面试·android jetpack
_一条咸鱼_4 小时前
揭秘 Android CoordinatorLayout:从源码深度解析其协同工作原理
android·面试·android jetpack
_一条咸鱼_4 小时前
揭秘 Android View 的 TranslationY 位移原理:源码深度剖析
android·面试·android jetpack
_一条咸鱼_4 小时前
揭秘 Android NestedScrollView 滑动原理:源码深度剖析
android·面试·android jetpack
_一条咸鱼_4 小时前
深度揭秘:Android NestedScrollView 拖动原理全解析
android·面试·android jetpack
_小马快跑_4 小时前
重温基础:LayoutInflater.inflate(resource, root, attachToRoot)参数解析
android
_一条咸鱼_4 小时前
揭秘!Android RecyclerView 预取(Prefetch)原理深度剖析
android·面试·android jetpack
_一条咸鱼_4 小时前
揭秘 Android ImageView:从源码深度剖析使用原理
android·面试·android jetpack