PythonMySQL专栏

解决MAC+ MySQL 8 错误:Authenticatio

2019-08-22  本文已影响2人  ocarol

环境

错误信息

Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/mysql/lib/plugin/caching_sha2_password.so, 2): image not found

原因

官方文档:
https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password

借鉴文档:
https://blog.51cto.com/fengfeng688/2147169

解决办法1

  1. 打开系统偏好设置,找到mysql,点击Initialize Database。
  2. 输入你的密码。
  3. 选择‘Use legacy password‘。
  4. 重启mysql服务。
  5. 重新使用Navicat链接数据库

解决办法2

用终端连接MySQL,然后执行以下命令:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'yourpassword';

此方法来自:
https://stackoverflow.com/questions/50169576/mysql-8-0-11-error-connect-to-caching-sha2-password-the-specified-module-could-n

解决办法3

修改my.cnf 文件,再重启MySQL:

vim my.cnf
[mysqld]
default_authentication_plugin=mysql_native_password
上一篇 下一篇

猜你喜欢

热点阅读