mysql数据库错误ERROR 1130:Host '' is not allowed
网上转的,第一个方法试了没成,第二个ok。 ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL server 解决方法: 1。 改表法。可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,
网上转的,第一个方法试了没成,第二个ok。
ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL server
解决方法:
1。 改表法。可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"
mysql -u root -pvmwaremysql>use mysql;mysql>update user set host = '%' where user = 'root';mysql>select host, user from user;
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 'root'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT
OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'10.10.40.54' IDENTIFIED BY '123456' WITH GRANT OPTION;
上一篇: 利用SQL注入漏洞登录后台的实现方法
下一篇: 这个语句循环了几次
推荐阅读
-
MYSQL Error 1130:Host '计算机名' is not allowed to connect to this MySQL server
-
mysql数据库错误ERROR 1130:Host '' is not allowed
-
IT忍者神龟之mysql远程连接:ERROR1130(HY000):Host'*.*
-
关于对连接数据库时出现1130-host “**” is not allowed to connect to this MySql/mariadb server 的错误解决方法
-
MySQL错误:ERROR 1064 (42000): use near 'order’解决
-
Host '127.0.0.1' is not allowed to connect to this MySQL server