远程连接mysql的“Communications link failure”错误解决方案
来源:互联网 发布:知乎 辐照食品 编辑:程序博客网 时间:2024/05/18 10:57
最近忙着做毕设的东西,用到了mysql存储一些系统元数据,在使用系统ip地址连接的时候出现错误,但是使用localhost连接mysql却没有问题。
错误信息:Communications link failure,Last packet sent to the server was 0 ms ago.
最初想到的是授权问题,即授权制定的数据库有远程访问权限。有两种方法:
1)采用改表法
mysql -u root -p mysql>use mysql; mysql>update user set host = '%' where user = 'ssj'; mysql>select host, user from user;
2)授权法
GRANT ALL PRIVILEGES ON CloudBus.* TO 'ssj'@'%'; //CloudBus是我的数据库名称,ssj是我的mysql用户名FLUSH PRIVILEGES;
然而授权法根本没有用,而改表法则提示user表中已经有了这条记录。那么这个原因究竟是在哪里呢?经过网上一番查找,才发现原来是mysql配置文件的问题。修改mysql的配置文件my.cnf(WINDOWS下面应该是my.ini),将bind-address=127.0.0.1这一行注释掉就好了。
- 远程连接mysql的“Communications link failure”错误解决方案
- mysql异常CommunicationsException: Communications link failure的解决方案
- Mysql 远程链接 Communications link failure
- MySQL连接池“Communications link failure”的问题
- MySQL连接超时Communications link failure
- MySQL连接超时Communications link failure
- sqoop连接mysql出现 Communications link failure
- mysql: Communications link failure
- mysql Communications link failure
- mysql 中Communications link failure的解决方法
- mysql 中Communications link failure的解决方法
- Mysql Communications link failure 问题的解决
- MySql的Communications link failure解决办法
- mysql - Communications link failure的解决办法
- MySql的Communications link failure解决办法
- java工程连接远程MySQL数据库报错:Communications link failure due to underlying exception
- Communications link failure一个解决方案
- ubuntu16.04下eclipse使用 jdbc连接本地mysql出现:Communications link failure错误
- JDK中的URLConnection参数详解
- KT (Kepner-Tregoe)
- 实时3D地形引擎开坑
- 对session和cookie的一些理解
- 基数排序
- 远程连接mysql的“Communications link failure”错误解决方案
- 登录页的验证码
- 怎样在Access和MS Sql Server中使一列字段自动编号增加(如 id int 主键 这一列自动增加)
- Oracle的表空间quota详解(ORA-01536,ORA-01950)
- NSUserDefaults简介及使用
- C++编程隐蔽错误:error C2533: 构造函数不能有返回类型
- 基类对象对派生类对象的切割问题
- 50个超酷photoshop动作演示及下载
- 对session和cookie的一些理解二