Home > Database > Mysql Tutorial > MySQL ERROR 2013 (HY000)错误解决方法_MySQL

MySQL ERROR 2013 (HY000)错误解决方法_MySQL

WBOY
Release: 2016-06-01 13:04:50
Original
1464 people have browsed it

当通过 TCP/IP 连接 MySQL 远程主机时,出现 ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 104 。

如果是在linux shell命令行中直接打 mysql 命令,能够顺利连上 MySQL,执行查询语句也比较正常,但如果执行 STOP SLAVE; 命令时就随机出现 ERROR 2013 (HY000): Lost connection to MySQL server during query 问题。而如果把操作命令写到脚本文件再去执行该脚本文件的话,则必然出现 Lost connection to MySQL server at 'reading initial communication packet', system error: 111。

要是无论通过什么途径远程访问都出现错误可以认为是系统有防火墙之类的限制,但现在这种奇怪的抽筋现象让人百思不得其解。最后找到的解决方法是在 my.cnf 里面的 [mysqld] 段增加一个启动参数

代码如下:


skip-name-resolve


问题消失。但原因还是想不出所以然。
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template