300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > mysql远程连接 Host * is not allowed to connect to this MySQL server

mysql远程连接 Host * is not allowed to connect to this MySQL server

时间:2023-03-10 03:28:20

相关推荐

mysql远程连接 Host * is not allowed to connect to this MySQL server

原文链接:/database/mysql/45230.htm

如果mysql不支持远程连接,会出现提示:错误代码是1130,ERROR 1130: Host * is not allowed to connect to this MySQL server ,

解决此问题有以下2个方法:

localhost改成%

进入mysql的BIN目录

mysql -u root -p

mysql>use mysql;

mysql>update user set host =’%'where user =’root’;

mysql>flush privileges;

具体分析

1、在本机登入mysql后,更改“mysql”数据库里的“user”表里的“host”项,从”localhost”改为'%'。

mysql>

mysql>use mysql;

mysql>select 'host' from user where user='root';

#查看mysql库中的user表的host值(即可进行连接访问的主机/IP名称)

mysql>update user set host = '%' where user ='root';

#修改host值(以通配符%的内容增加主机/IP地址,当然也可以直接增加某个特定IP地址,如果执行update语句时出现ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY' 错误,需要select host from user where user = 'root';

查看一下host是否已经有了%这个值,如果有了直接执行下面的flush privileges;即可)

mysql>flush privileges;

mysql>select host,user from user where user='root';

mysql>quit

另一种方法

如果你使用的是phpmyadmin我们可以登录phpmyadmin然后在权限管理中进入,这里会看到所有的用户了,你找到root用户点击修改,然后把域修改成%号即可了(注意,你必须是root权限用户登录哦,否则是不可以修改的)

from:/database/mysql/45230.htm

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。