How to Allow MySQL Client to Connect to Remote MySql
How to Allow MySQL Client to Connect to Remote MySQ
By default, MySQL does not allow remote clients to connect to the MySQL database.
If you try to connect to a remote MySQL database from your client system, you will get “ERROR 1130: Host is not allowed to connect to this MySQL server” message as shown below.
$ mysql -h 192.168.1.8 -u root -p Enter password: ERROR 1130: Host '192.168.1.4' is not allowed to connect to this MySQL server
You can also validate this by doing telnet to 3306 mysql port as shown below, which will also give the same “host is not allowed to connect to this mysql server” error message as shown below.
$ telnet 192.168.1.8 3306 host 192.168.1.4 is not allowed to connect to this mysql server
If you want to allow a specific client ip-address (for example: 192.168.1.4) to access the mysql database running on a server, you should execute the following command on the server that is running the mysql database.
$ mysql -u root -p Enter password: mysql> use mysql mysql> GRANT ALL ON *.* toroot@'192.168.1.4' IDENTIFIED BY 'your-root-password'; mysql> FLUSH PRIVILEGES;
Also, update firewall rules to make sure port# 3306 is open on the server that is running the mysql database.
After the above changes, when you try to connect to the mysql database from a remote client, you’ll not get the “Host is not allowed to connect to this MySQL server” error message anymore.
If you want to allow all clients to connect you may do following
GRANT ALL ON *.* to root@’%’ ;
How to Allow MySQL Client to Connect to Remote MySql的更多相关文章
- mysql Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’
mysql Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ 今天在linux中安装了mys ...
- Mysql -- Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’解决方法
启动mysql 报错: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/m ...
- mysql,Can 't connect to local MySQL server through socket '/tmp/mysql.sock '(2) "
# mysql -uroot -pEnter password:ERROR 2002 (HY000): Can't connect to local MySQL server through sock ...
- 解决mysql:Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
(一)出现问题的的报错信息 Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) ( ...
- mysql Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
错误原因:/var/lib/mysql目录中socket文件不存在.连接mysql服务器有两种方式:tcp连接,通过socket文件连接.通过socket文件,启动mysql服务,mysql服务会自动 ...
- 配置远程连接mysql数据库 Connect to remote mysql database
设有本地机器(local machine), ip地址为localip 远程机器(remote machine), ip地址remoteip 要通过在local machine的终端连接remote ...
- mysql: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
https://www.cnblogs.com/jpfss/p/9734487.html (mysql.sock错误解决方案)
- 连接Mysql提示Can’t connect to local MySQL server through socket的解决方法
mysql,mysqldump,Mysqladmin,php连接mysql服务常会提示下面错误: ERROR 2002 (HY000): Can't connect to local MySQL se ...
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
有时候,当我们使用"mysql"."mysqladmin"."mysqldump"等命令管理数据库时,服务器抛出类似如下错误: 一.错误现场 ...
随机推荐
- APP自动化测试中Monkey和 MonkeyRunner
在设计了测试用例并通过评审之后,由测试人员根据测试用例中描述的规程步步执行测试,得到实际结果与期望结果的比较.在此过程中,为了节省人力.时间或硬件资源,提高测试效率,便引入了自动化测试的概念.自动化测 ...
- Head First 设计模式 --4 工厂模式 抽象工厂模式
(用到了依赖倒置原则) 我们写的代码中,有的时候可能会出现根据外面给定的不同的参数在方法中根据参数实例化不同的实例,就是会根据不同的参数会new出不同的实例.如果这么写了,这段代码会非常的脆弱,一旦出 ...
- Authentication和Authorization的区别
搞不太清楚Authentication和Authorization的区别,在网上搜了一下,lucky16的一篇文章讲的通俗,看了就懂,记录下来: 你要登机,你需要出示你的身份证和机票,身份证是为了证明 ...
- Queue的push和front操作
#include <queue> #include <cstdlib> using namespace std; int main(){ queue<int> qu ...
- jQuery 获取checkbox 获取值
//全选 $("[name='checkbox']").attr("checked",'true'); //取消全选 $("[name='checkb ...
- 二分图最大权最小权完美匹配模板KM
在网上找了一份挺好的模板,先标一下哦~链接君:http://blog.csdn.net/abcjennifer/article/details/5844579 #include <iostrea ...
- Launch Screen在iOS7/8中的实现
Launch Screen在iOS7/8中的实现 目前项目中需要解决的问题是: 兼容iOS7和iOS8,之前的版本不需要支持了 实现兼容3.5.4.4.7和5.5寸屏幕,竖屏的Lauch Screen ...
- C# Enum 简易权限设计 使用FlagsAttribute属性
基本權限設計: /// <summary> /// 權限列舉 /// </summary> [FlagsAttribute] public enum Permissions { ...
- git push (第一次) (转)
原地址 http://blog.csdn.net/kazeik/article/details/9113891 下图是github在创建仓库后给的提示:按它一步步操作下去就可以了. 下图是在git命 ...
- hdoj 4323
题意:给你n个数,m个查询,查询中包括一个数和一个最大编辑距离d,问n个数中和这个数的编辑距离不超过d的有多少个 编辑距离:http://baike.baidu.com/view/2020247.ht ...