目录:
- Host 'shizhan04' is not allowed to connect to this MySQL server 问题,及解决方案
- Access denied for user 'root'@'localhost' (using password: YES) 问题,及解决方案
1. 问题: "Host 'shizhan04' is not allowed to connect to this MySQL server"
方案:
服务端 (主节点授权)mysql 授权
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'youpassword' WITH GRANT OPTION;
2. 问题:Access denied for user 'root'@'localhost' (using password: YES)
方案:
从节点搭建mysql 环境!!!
$ vi /etc/my.conf
在[mysqld]标签下 添加
skip-grand-tables
进入mysql中,此时不需要密码
>use mysql
>update user set password=password("new password") where username = 'root'
>quit
$/etc/init.d/mysqld restart
在[mysqld]标签下 取消该内容
skip-grand-tables
$mysql -uroot -p
输入new password
该问题解决~