解决mysql"Access denied for user'root'@'IP地址'"问题

出现这种问题,主要的原因就是权限配置的时候 没有配置正确。

解决方法如下:

(1)登陆进MYSQL 时, mysql -u root -p

(2)show grants; 会出现root如下的权限表示:GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '565491d704013245' WITH GRANT OPTION

解释:

grant 权限1,权限2,…权限n on 数据库名称.表名称 to 用户名@用户地址 identified by ‘连接口令’;

(3)grant all privileges on *.* to 'root'@'%' with grant option;

(4)FLUSH PRIVILEGES;

(5)exit


你可能感兴趣的:(linux操作入门)