应用程序试图连接MySQL 8
出现这个错误是因为MySQL在新版本中增加了安全级别。它已将其默认认证插件从mysql_native_password
更改为caching_sha2_password
。
解决这个问题的方法是
- 首先使用下面的命令找到您的
my.cnf
文件位置。
mysql --help | grep "Default options" -A 1
- 然后更新
my.cnf
,使用下面的行
[mysqld]
# Only allow connections from localhost
bind-address = 127.0.0.1
**default-authentication-plugin=mysql_native_password** // add this line
- cd/usr/local/bin
- mysql。服务器停止
- mysql。服务器启动
这将解决您的问题:)