今天1网友求助,说自己PHPmyadmin能够正常连接数据库,使用sqlyog报错:
解决方法:
1,改动user表
mysql -u root -p
mysql>use mysql;
mysql>update user set host = '172.27.241.1' where user ='root';
mysql>flush privileges;
2.指定授权
mysql -u root -p
mysql>use mysql;
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'172.27.241.1' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
ERROR 1130: Host '172.27.214.1' is not allowed to connect to thisMySQL server
解决方法:
1,改动user表
mysql -u root -p
mysql>use mysql;
mysql>update user set host = '172.27.241.1' where user ='root';
mysql>flush privileges;
2.指定授权
mysql -u root -p
mysql>use mysql;
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'172.27.241.1' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
mysql>flush privileges;
注意:
1.精准授权,即那个账号,哪台主机。须要哪种权限。必须写明。最好不要泛授权;
2.记着运行完每条命令要flush privileges;