ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL

当使用Mysql帐号远程登陆的时候,出现类似如下错误:
ERROR 1130: Host ‘192.168.1.3‘ is not allowed to connect to this MySQL

解决办法:

1. 改表法(可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%")

c:/mysql/mysql server 5.1>mysql -u root -p

输入相应密码

mysql>use mysql;

mysql>show tables; (确认一下表user是否存在)

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

mysql>quit

退出mysql

c:/mysql/mysql server 5.1>net stop mysql

c:/mysql/mysql server 5.1>net start mysql

现在远程连接这部mysql服务器就行了

c:/mysql/mysql server 5.1>mysql -h 192.168.1.3 -u root -p

2. 授权法
例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。

GRANT ALL PRIVILEGES ON *.* TO ‘myuser‘@‘%‘ IDENTIFIED BY ‘mypassword‘ WITH GRANT OPTION;
如果你想允许用户myuser从ip为192.168.1.3的主机连接到mysql服务器,并使用mypassword作为密码
GRANT ALL PRIVILEGES ON *.* TO ‘myuser‘@‘192.168.1.3‘ IDENTIFIED BY ‘mypassword‘ WITH GRANT OPTION;

ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL

原文地址:https://www.cnblogs.com/rhythm-y/p/8945277.html

时间: 2024-11-05 14:45:47

ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL的相关文章

遇到问题,本地PHP环境连接其他主机的Mysql 出现ERROR 1130: Host '192.168.1.222' is not allowed to connect to this MySQL server

问题描述,1 检查mysql服务是否启动, 2 关闭防火墙                    Netfilter/Iptables    关闭方式[[email protected] ~]#iptables -F                    SELINUX     关闭方式 [[email protected] ~]#setsebool -P samba_enable_home_dir on             3 查看是否有监听mysql端口  netstat -an |gr

ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY'

use mysql mysql> select host, user from user; 将相应用户数据表中的host字段改成'%': update user set host='%' where user='root'; ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY' 不予理会 flush privileges; 重新远程连接OK ERROR 1130: Host '192.168.1.3' is not allo

Mysql远程连接报错:SQL Error (1130): Host '192.168.6.128' is not allowed to connect to this MySQL server

通过SQLyog连接linux中的MySQL报错问题:SQL Error (1130): Host '192.168.6.128' is not allowed to connect to this MySQL server说明你所连接的用户账户没有远程连接的权限,只能在本机localhost登录需要更改 mysql 数据库里的 user表里的 host字段 把localhost改称%下面是我设置的远程连接步骤,请参考: 1.登录MySQL  mysql -uroot -proot2.进入数据库

ERROR 1130 (HY000): 192.168.111.1'' is not allowed to connect to this MySQL server

root 无法通过navicat 远程以root登录 虚机授予权限并刷新 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'; FLUSH PRIVILEGES; ERROR 1130 (HY000): 192.168.111.1'' is not allowed to connect to this MySQL server

解决ERROR 1130 (HY000): Host '192.168.1.9' is not allowed to connect to this MySQL server

本机是mysql的数据库,想用另一台ip为192.168.1.9的连接这个mysql数据库,可是报了这个错误. 查询得到2个方法 第一个是在user表把localhost改为%, 我这么做后不仅没有解决,本地连接都要[email protected]%这么做了(现在想想好像失误把所有localhost都给改了). 第二个方法就生效了. 终端登陆mysql,执行一句sql: GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.9' IDENTIFIED

ERROR 1130 (HY000): Host '192.168.0.190' is not allowed to connect to this MySQL serv

环境: CentOS6.2.MySQL5.1 问题描述: 在配置文件中将需要连接的MySQL的host设置为192.168.0.190(其实就是我自己的IP地址),然后运行自己的程序,结果返回MySQL错误提示,如标题所示.根据字面意思就是不允许通过192.168.0.190连接MySQL服务器. 问题分析: 根据错误提示分析,使用localhost连接MySQL是可以的,但是192.168.0.190去连接却被拒绝,那么首先肯定数据库服务器是没有问题的,应该是权限的问题,因为自己对MySQL也

连接mysql时报:message from server: "Host '192.168.76.89' is not allowed to connect to this MySQL server

处理方案: 1.先用localhost方式连接到MySQL数据库,然后使用MySQL自带的数据库mysql; use mysql: 2.执行:select host from user where user = 'root';  发现,host的值就是localhost. 所以将它的值改掉:update user set host='%' where user = 'root'; 3.修改完成后,执行:flush privileges; 将修改内容生效,再次配置时,用IP地址或者localhos

Host '192.168.1.21' is not allowed to connect to this MySQL server

报错:1130-host ... is not allowed to connect to this MySql server 解决方法: 1. 改表法. 可能是你的帐号不允许从远程登陆,只能在localhost.这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%" mysql -u roo

mysql 1130 ERROR 1130: Host xxx.xxx.xxx.xxx is not allowed to connect to this MySQL server

mysql -u root -p  mysql;use mysql;  mysql;select 'host' from user where user='root';  mysql;update user set host = '%' where user ='root';  mysql;flush privileges; mysql 1130 ERROR 1130: Host xxx.xxx.xxx.xxx is not allowed to connect to this MySQL se