安裝navicat以後新建鏈接出現了2059的錯誤
網上查詢事後,發現這個錯誤出現的緣由是在mysql8以前的版本中加密規則爲mysql_native_password,而在mysql8之後的加密規則爲caching_sha2_password。mysql
解決此問題有兩種方法,一種是更新navicat驅動來解決此問題,一種是將mysql用戶登陸的加密規則修改成mysql_native_password。;根據網上大部分建議採起了第二種方式:sql
1.打開doc窗口win+d輸入cmd打開
進入mysql sever安裝bin目錄輸入
mysql -u root -p
輸入root用戶的密碼
![](http://static.javashuo.com/static/loading.gif)
2.選擇數據庫
輸入
use mysql
![](http://static.javashuo.com/static/loading.gif)
3.查看加密的規則
輸入
select Host,User,plugin from mysql.user;
![](http://static.javashuo.com/static/loading.gif)
加密方式是新的加密方式
4.更改回原來的加密方式
輸入
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY'root用戶的密碼';
刷新
FLUSH PRIVILEGES;
![](http://static.javashuo.com/static/loading.gif)
5.再次查看加密方式
select Host,User,plugin from mysql.user;
![](http://static.javashuo.com/static/loading.gif)
6.如今再用navicat去鏈接數據庫就ok了