1.Host is not allowed to connect to this MySQL server
use mysql;
update user set host="%" where user='root';
update user set host="%" where user='root';
重新连接:ok
2.错误1045(28000):用户’root’@'localhost’的访问被拒绝(使用密码:YES)
1).直接 输入 mysql
具体原因未知,我这样就可以进入了。
2)
service mysqld stop # 停止mysql Stopping mysqld: [ OK ]
/usr/bin/mysqld_safe --skip-grant-tables # 跳过密码验证
mysql # 直接进入并修改密码
use mysql;
update user set password=PASSWORD(“123456”) where User=‘root’;
service mysqld start # 启动mysql ok
这样应该就没问题了