1130-host ... is not allowed to connect to this MySql server
来源:互联网 发布:js跨域cookie 编辑:程序博客网 时间:2024/04/30 12:30
一:问题描述
当远程连接数据库的时候,报错:
二:出错原因
你要远程连接的数据库不允许你这台机器访问。
三:解决办法
有两种方式可以解决:
在被远程访问的机器上做以下操作:
1:update user表
mysql> use mysql;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -A Database changed mysql> update user set host='%' where user ='root'; mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)
2:赋予权限
例如,你想让该服务器的所有数据库可以被任何主机通过用户myuser/mypassword进行远程连接。
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
FLUSH PRIVILEGES;
如果你想允许用户myuser从ip为192.168.1.6的主机连接到mysql服务器,并使用mypassword作为密码
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
FLUSH PRIVILEGES;
如果你想允许用户myuser从ip为192.168.1.6的主机连接到mysql服务器的dk数据库,并使用mypassword作为密码
GRANT ALL PRIVILEGES ON dk.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
FLUSH PRIVILEGES;
示例:允许所有主机可以访问该服务器下的所有数据库,以用户root就行访问:
mysql> use mysql;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -A Database changedmysql> grant all privileges on *.* to 'root'@'%';Query OK, 0 rows affected (0.03 sec) mysql> select host,user from user;+------------+------+| host | user |+------------+------+| % | root || 127.0.0.1 | root || ::1 | root || target\_pc | root |+------------+------+4 rows in set (0.00 sec) mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)
--本篇文章参考自:http://www.cnblogs.com/xyzdw/archive/2011/08/11/2135227.html
- host is not allowed to connect to this MySQL server
- Host is not allowed to connect to this MySQL server
- host ... is not allowed to connect to this MySql server
- Host * is not allowed to connect to this MySQL server
- host is not allowed to connect to this MySql server
- Host is not allowed to connect to this MySQL server
- host ... is not allowed to connect to this MySql server
- Host '***' is not allowed to connect to this MySQL server"
- host ... is not allowed to connect to this MySql server
- Host is not allowed to connect to this mysql server,
- Host '***' is not allowed to connect to this MySQL server
- [MySQL]MySQL Error 1130 Host 'localhost' is not allowed to connect to this MySQL server
- Mysql 远程连接错误:1130-host IP is not allowed to connect to this MySql server
- MySQL Error 1130 Host 'localhost' is not allowed to connect to this MySQL server
- MySQL Error 1130 Host 'localhost' is not allowed to connect to this MySQL server
- mysql:ERROR 1130: Host '192.168.0.102' is not allowed to connect to this MySQL server
- 【MySql】报错:1130-host ... is not allowed to connect to this MySql server
- MySQL Error 1130 Host 'localhost' is not allowed to connect to this MySQL server
- Cocos2d-x_播放帧动画
- 第四周 项目一-三角形类的构造函数(一)
- ListView不同行加载不同布局
- 树转二叉树的过程
- Android Button原理
- 1130-host ... is not allowed to connect to this MySql server
- RichText控件添加到对话框上不能运行的解决方法
- 我的vi命令集
- ADT/Eclipse字体大小、代码自动补全、代码自动对齐的设置
- tomcat7配置用户
- 下面哪段程序能够正确的实现了GBK编码字节流到UTF-8编码字节流的转换
- 【编程笔记】2012 - 2016年
- Compare Version Numbers
- 第四周项目一:三角形类的构造函数(2):默认构造函数