MySQL远程连接丢失问题解决方法Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0
最近远程连接mysql总是提示
Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0
很明显这是连接初始化阶段就丢失了连接的错误
其实问题很简单,都是MySQL的配置文件默认没有为远程连接配置好,只需要更改下MySQL的配置文件即可。
具体的解决步骤如下:
找到并修改my.cnf文件。在不同的Linux系统下,my.cnf放在不同的位置。这里以Ubuntu Server做示例,其他系统请根据情况自行找到my.cnf的路径。一般只会存放在/etc/my.cnf或者/etc/mysql/my.cnf下。
首先用vim打开my.cnf:
vim /etc/mysql/my.cnf
看看是否有绑定本地回环地址的配置,如果有,注释掉下面这段文字:(在文字之前加上#号即可)
bind-address = 127.0.0.1
然后找到[mysqld]部分的参数,在配置后面建立一个新行,添加下面这个参数:
skip-name-resolve
保存文件并重启MySQL:
/etc/init.d/mysql restart
这样就会发现,问题已经解决了!远程连接不会丢失了。
MySQL远程连接丢失问题解决方法Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0的更多相关文章
- Lost connection to MySQL server at ‘reading initial communication packet', system error: 0 mysql远程连接问题
在用Navicat for MySQL远程连接mysql的时候,出现了 Lost connection to MySQL server at ‘reading initial communicatio ...
- mysql远程连接问题 Lost connection to MySQL server at ‘reading initial communication packet', system error: 0
在用Navicat for MySQL远程连接mysql的时候,出现了 Lost connection to MySQL server at ‘reading initial communicatio ...
- 虚拟机中MySQL连接问题:Lost connection to MySQL server at 'reading initial communication packet, system error: 0 以及 host is not allowed to connect mysql
环境:在VirtualBox中安装了Ubuntu虚拟机,网络使用了NAT模式,开启了端口转发. 局域网内其他计算机访问虚拟机中的MySQL Server出现两个问题: Lost connection ...
- mysql登陆时出现ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0
有4到5天没开mysql,这天晚上打=打开phpstudy,想进去mysql练习练习,结果丢给我这个 ERROR 2013 (HY000): Lost connection to MySQL serv ...
- Mysql Lost connection to MySQL server at ‘reading initial communication packet', system error: 0
在用Navicat for MySQL远程连接mysql的时候,出现了 Lost connection to MySQL server at ‘reading initial communicatio ...
- mysql远程连接错误提醒:2013-Lost connection to MySQL server at ‘reading initial communication packet', system error: 0
因为没有匹配/etc/hosts.allow. 解决方法: 1.在hosts.allow 文件中添加 mysqld:ALL [root@ucDB204 ~]# cat /etc/hosts.allow ...
- navicat 出现 mysql远程连接问题 Lost connection to MySQL server at ‘reading initial communication packet', system error: 0
今天做服务器上的东西需要看数据库时,突然发现有这个报错,然后自己也查了很多资料 我最后找到一个在my,cnf配置文件中mysqld下加入一条 max_allowed_packet = 500M 也就是 ...
- Lost connection to MySQL server at 'reading initial communication packet', system error: 0的一个解决方案
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT在icmp之前/etc/init.d/iptables restar ...
- lost connection to mysql server at "reading initial communication packet",system error:2
随机推荐
- React Native知识2-Text组件
Text用于显示文本的React组件,并且它也支持嵌套.样式,以及触摸处理.在下面的例子里,嵌套的标题和正文文字会继承来自styles.baseText的fontFamily字体样式,不过标题上还附加 ...
- Android—判断当前时间段
思路:获取当前时间相对于当天的分钟数,然后按照时间顺序依次与时间段后面的时间(转化为分钟数)比较(如8:00-9:00,跟9:00比较). 部分代码: 当前时间 Calendar calendar = ...
- Jsoup解析html终于成功了!!!
package com.eric.pickupjoke.activity; import java.io.IOException; import java.io.InputStream; import ...
- TortoiseSVN提交提示423 Locked的解决办法
往svn上提交文件时,文件可能被另一个人占用,这时提交就会报423Locked错误. 此办法是阅读官方文档(TortoiseSVN-1.6.16-zh_CN.pdf) 4.21 锁部分提供的办法: 首 ...
- FastDFS+Nginx(单点部署)事例
FastDFS是由淘宝的余庆先生所开发,是一个轻量级.高性能的开源分布式文件系统,用纯C语言开发,包括文件存储.文件同步.文件访问(上传.下载).存取负载均衡.在线扩容.相同内容只存储一份等功能,适合 ...
- sublime text2 bracketHighLighter 配置
一.BracketHighlighter能为ST提供括号,引号这类高亮功能,但安装此插件后,默认没有高亮,只有下划线表示,不是很醒目,需要如下配置1. 在ST中用package control安装Br ...
- Android layout_weight理解
layout_weight属性只能用于LinearLayout布局,不能用于RelativeLayout等其他布局: layout_weight属性如果不设定,默认值为0: layout_weight ...
- mvc页面跳转
用例列举: RedirectToAction: return RedirectToAction("PublicPreview", controllerName, new { id ...
- W3School-CSS 分类 (Classification) 实例
CSS 分类 (Classification) 实例 CSS 实例 CSS 背景实例 CSS 文本实例 CSS 字体(font)实例 CSS 边框(border)实例 CSS 外边距 (margin) ...
- 遇到shell重定向的一个奇怪问题:'消失'的标准输入!
需求: 把找到的文件逐行输出,然后用rm在许可的情况下删除 前置准备: $ls rm.sh test1 test2 test3 test4 test5 test6 $cat rm.sh #! / ...