1130 -Host '' isnot allowed to connect to this MySQL server

xiaoxiao2021-02-28  66

改表法。 可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%" mysql>update user set host = '%' where user = 'root'; mysql>select host, user from user;

执行过程中会遇到ERROR 1175 (HY000): You are using safe update mode and you tried to update a table without a WHERE that 

uses a KEY column

执行     SET SQL_SAFE_UPDATES = 0;可以去除安全模式 然后就可以改了

改也改了 还是不

授权法

mysql>GRANT   ALL   PRIVILEGES   ON   *.*   TO   'root'@'%'   WITH   GRANT   OPTION //赋予任何主机访问数据的权限

mysql>FLUSH   PRIVILEGES //修改生效

修改之后就OK了,当然我也修改了防火墙和阿里云的安全组.防火墙和安全组分别添加3306端口.防火墙修改见如下链接

防火墙修改

转载请注明原文地址: https://www.6miu.com/read-72172.html

最新回复(0)