MYSQL 2059 Navicate無法連接

安裝 了mysql8後出現2059錯誤。

原因爲安裝時選擇了強加密規則caching_sha2_password,與之前的mysql5.7的mysql_native_password規則不同,navicate驅動目前不支持新加密規則。

我們需要更改加密規則
在這裏插入圖片描述

就像圖中一樣

  1. 進入MySQL

    mysql -u root -p
    
  2. 查看加密規則

    use mysql;
    
    select user,plugin from user where user='root';
    +------+-----------------------+
    | user | plugin                |
    +------+-----------------------+
    | root | caching_sha2_password |
    +------+-----------------------+
    1 row in set (0.00 sec)
    
  3. 修改加密規則

    ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
    
  4. 刷新權限

    flush privileges;
    
  5. 查看規則

    select user,plugin from user where user='root';
    +------+-----------------------+
    | user | plugin                |
    +------+-----------------------+
    | root | mysql_native_password |
    +------+-----------------------+
    1 row in set (0.00 sec)
    
  6. 然後測試連接

在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章