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

你可能感兴趣的:(基本配置)