安裝 了mysql8
後出現2059錯誤。
原因爲安裝時選擇了強加密規則caching_sha2_password,與之前的mysql5.7的mysql_native_password規則不同,navicate驅動目前不支持新加密規則。
我們需要更改加密規則
就像圖中一樣
-
進入MySQL
mysql -u root -p
-
查看加密規則
use mysql; select user,plugin from user where user='root'; +------+-----------------------+ | user | plugin | +------+-----------------------+ | root | caching_sha2_password | +------+-----------------------+ 1 row in set (0.00 sec)
-
修改加密規則
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
-
刷新權限
flush privileges;
-
查看規則
select user,plugin from user where user='root'; +------+-----------------------+ | user | plugin | +------+-----------------------+ | root | mysql_native_password | +------+-----------------------+ 1 row in set (0.00 sec)
-
然後測試連接