我遇到了和这个问题一模一样的情况。问题在于解决方案在我的情况下并不是很易于理解。
MySQL报错:无法加载认证插件“caching_sha2_password”:dlopen(/usr/local/mysql/lib/plugin/caching_sha2_password.so, 2):找不到文件
在我的Mac系统偏好设置中没有任何初始化DB的内容。第二个答案说:
转到my.cnf文件,并在[mysqld]部分中添加以下行:
default-authentication-plugin=mysql_native_password
从终端登录mysql服务器:
run mysql -u root -p
,然后在shell内执行此命令:ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '[password]';
用exit退出mysql shell,并运行sudo service mysqld restart
关于如何找到my.cnf文件的信息可以在这篇文章中找到,其中提到:
mysql --help
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf
The following groups are read: mysql client
The following options may be given as the first argument:
--print-defaults Print the program argument list and exit.
--no-defaults Don't read default options from any option file.
--defaults-file=# Only read default options from the given file #.
--defaults-extra-file=# Read this file after the global files are read.
看起来有三个地方存放my.cnf文件,我不知道应该编辑哪一个,也不知道如何编辑。 另外一个解决方案可以在这个帖子中找到: 安装MySQL后,使用CLI进行身份验证,例如:
mysql -uroot
然后运行以下命令以使用旧的身份验证方法:
ALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY 'PASSWORD';
最后,刷新权限:
FLUSH PRIVILEGES;
现在,您应该能够再次使用SequelPro连接(使用指定的密码)。
多个用户在答案评论中报告第二种解决方案会导致Sequel Pro崩溃,因此我想这是一种欺骗性的方法。
我如何将mysql ver 8.0.12连接到SequelPro?我应该使用另一个GUI吗?似乎工作台也会出现这个问题。
以防万一,我正在使用Mac OSX Sierra 10.13.5。