今天1网友求助,说自己PHPmyadmin可以正常连接数据库,使用sqlyog报错:
ERROR 1130: Host ‘172.27.214.1‘ is not allowed to connect to thisMySQL server
root case:MySQL默认所有帐号不允许从远程登陆,只能在localhost
解决方法:
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;
版权声明:本文为博主原创文章,未经博主允许不得转载。
ERROR 1130: Host '' is not allowed to connect to thisMySQL server
时间: 2024-10-09 17:09:33