修复尝试连接 MySQL 时出现'this authentication plugin is not supported'的问题



应用程序试图连接MySQL 8

出现这个错误是因为MySQL在新版本中增加了安全级别。它已将其默认认证插件从mysql_native_password更改为caching_sha2_password

解决这个问题的方法是

  1. 首先使用下面的命令找到您的my.cnf文件位置。
mysql --help | grep "Default options" -A 1
  1. 然后更新my.cnf,使用下面的行
[mysqld]
# Only allow connections from localhost
bind-address = 127.0.0.1
**default-authentication-plugin=mysql_native_password** // add this line
  1. cd/usr/local/bin
  2. mysql。服务器停止
  3. mysql。服务器启动

这将解决您的问题:)

相关内容

最新更新