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’; 修改密码

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