sequel pro连接mysql失败

最近在macbookpro上使用homebrew安装MySQL,然后使用sequel pro连接本地数据库。出现了如下错误

Unable to connect to host 127.0.0.1, or the request timed out.  Be sure that the address is correct and that you have the necessary privileges, or try increasing the connection timeout (currently 10 seconds).  MySQL said: Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/mysql/lib/plugin/caching_sha2_password.so, 2): image not found

然后再网上找到这个解释:“这个错误的原因是sequel pro,没有准备好进行新的用户登录,错误表明没有驱动,找到系统偏好设置,mysql安装驱动。”

可我在系统偏好设置里并没有找到mysql,于是按照网友的余下步骤去执行,

1、打开mysql的配置文件 my.cnf并添加

default-authentication-plugin=mysql_native_password

2、从终端进入mysql 服务器:mysql -uroot -p(顺便提一下,我的mysql默认是空密码)

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '[password]';

执行这个更改用户的密码。

3、退出并重启mysql :brew services restart mysql

然后就大功告成顺利解决问题

你可能感兴趣的:(mysql)