问题描述:
macOs 10.15 版本
mysql-8.0.22-macos10.15-x86_64
通过 navicat premium 连接本地mysql时报错:
2059 - Authentication plugin ‘caching_sha2_password’ cannot be loaded: dlopen(…/Frameworks/caching_sha2_password.so, 2): image not found
解决问题
1.打开终端,输入 mysql -u root -p 回车,登录mysql
mysql -u root -p
按提示输入密码,回车后登录成功;
2. 输入 use mysql; 使用 mysql 数据库:
mysql> use mysql;
3.输入 alter user ‘root’@‘localhost’ identified with mysql_native_password by ‘Reda@123’; 设置身份验证:
mysql> alter user 'root'@'localhost' identified with mysql_native_password by 'xxxxx';
注:
‘xxxxx’ 为mysql的root用户的登录密码;
回车后提示 ‘Query OK, 0 rows affected (0.00 sec)’ 表示修改成功.
4.输入 flush privileges; 刷新更改
mysql> flush privileges;
提示 ‘Query OK, 0 rows affected (0.01 sec)’ 表示成功