首页 > 数据库技术 > 详细

Mac navigate 无法连接5.7以后数据库版本

时间:2019-12-16 10:45:36      阅读:76      评论:0      收藏:0      [点我收藏+]

mac上用homebrew安装mysql步骤:

1.brew install mysql(默认安装mysql8)

安装完成后:启动mysql服务

2.bash mysql.server start

这个时候用navicat 连接会报错2059 Authentication plugin ‘caching_sha2_password‘ cannot be loaded

这是因为新版mysql数据库的加密方式变了:

3.登录数据库 mysql -u root -p

4.通过命令 select user,plugin from user where user=‘root‘; 我们可以发现加密方式是caching_sha2_password

 技术分享图片
技术分享图片
 5.然后使用命令:alter user ‘root‘@‘%‘ identified with mysql_native_password by ‘your password‘;

执行这个语句时如果报错“ERROR 1396 (HY000): Operation ALTER USER failed for ‘root‘@‘%‘”, 执行这个语句alter user ‘root‘@‘localhost‘ identified with mysql_native_password by ‘your password‘;  如果还是报错就执行第6步,如果没报错就走第7步

6.保留当前窗口,新打开一个窗口,重新进入mysql,执行该命令就可以了

再次查看,就发现加密方式已经更改:

技术分享图片

技术分享图片

7.接着找到my.cnf文件(不知道目录的可以通过brew list mysql来确定目录)并加上加密方式:

default_authentication_plugin=mysql_native_password

技术分享图片
技术分享图片8.保存后,重启mysql服务命令:mysql.server restart

 

作者:Mike
原文作者:有梦南柯
链接:https://www.jianshu.com/p/06897ac9f25d
原文来源:简书

Mac navigate 无法连接5.7以后数据库版本

原文:https://www.cnblogs.com/mike-JP/p/12047476.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!