Navicat 連接mysql報錯:1045 Access denied for user 'root'@'localhost' (using password: YES)

解決方案:授權遠程登錄(123456爲數據庫root用戶密碼)

首先使用root用戶登錄數據庫,然後依次執行以下命令。

use mysql;

grant all privileges on . to ‘root’@’%’ identified by ‘123456’;

flush privileges;

exit;

補充:

select host,user from user;查看

update user set host = ‘%’ where user = ‘root’ and host = ‘localhost’;修改權限

update user set password=password(‘zabbix’) where user = ‘root’; 修改密碼

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