ERROR 2013 (HY000): Lost connection to MySQL server at ‘reading authorization packet’, system error:
2014-11-06 14:59
597 查看
当WEB服务器负载高的时候,经常会出现这种错误,
原因:
MySQL默认connect_timeout是5秒,超过了这个时间MySQL的server端就会返回“Bad handshake”。
解决办法:
1.大多数时候设置"set global connect_timeout=60"是可以解决问题的;
我们可以通过执行“SHOW STATUS LIKE 'aborted%'”,可以观察到
觉得是否要增加connect_timeout的时间,"Aborted_connects"将会随着服务端放弃客户端初始连接而增加。如果"Aborted_connects"很大,并且不断增加,就需要增加"connect_timeout".
2.在MySQL的配置文件中[mysqld]添加"skip-name-resolve",减少域名解析的时间
3.部署服务器端的网络要好,至少大于100Mbps/s
4.如果是在调用mysql_query的时候出现的问题,那就需要把"net_read_timeout"的时间调成30秒,或者60秒,或者更大的值
5.如果还不能解决问题,那估计是你的SQL语句中含有BLOB这种大类型,我们就需要增加"max_allowed_packet"的值了
参考资料:
http://dev.mysql.com/doc/refman/5.0/en/error-lost-connection.html
原因:
MySQL默认connect_timeout是5秒,超过了这个时间MySQL的server端就会返回“Bad handshake”。
解决办法:
1.大多数时候设置"set global connect_timeout=60"是可以解决问题的;
我们可以通过执行“SHOW STATUS LIKE 'aborted%'”,可以观察到
Variable_name | Value |
---|---|
Aborted_clients | 6 |
Aborted_connects | 15010 |
2.在MySQL的配置文件中[mysqld]添加"skip-name-resolve",减少域名解析的时间
3.部署服务器端的网络要好,至少大于100Mbps/s
4.如果是在调用mysql_query的时候出现的问题,那就需要把"net_read_timeout"的时间调成30秒,或者60秒,或者更大的值
5.如果还不能解决问题,那估计是你的SQL语句中含有BLOB这种大类型,我们就需要增加"max_allowed_packet"的值了
参考资料:
http://dev.mysql.com/doc/refman/5.0/en/error-lost-connection.html
相关文章推荐
- ERROR 2013 (HY000): Lost connection to MySQL server at ‘reading authorization packet’, system error: 104原因和解决办法
- ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error:
- mysql连接远程数据库出现 ERROR 2013 (HY000) Lost connection to MySQL server at 'reading authorization packet',
- 2013 - Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0
- 手把手解决Mysql错误:Lost connection to MySQL server at 'reading authorization packet', system error: 0
- Lost connection to MySQL server at 'reading authorization packet', system error: 0
- 2013 Lost connection to MySQL server at 'handshake: reading initial communication packet'
- MYSQL 远程连接错误ERROR 2013 (HY000): Lost connection to MySQL server at
- lost connection to mysql server at 'reading initial communication packet',system error:2
- 遇见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的一个解决方案
- Lost connection to MySQL server at 'reading authorization packet' 处理解决办法
- 连接mysql出现Lost connection to MySQL server at 'reading initial communication packet', system error: 0
- [Err] [Dtf] 2013 - Lost connection to MySQL server at 'reading initial communication packet', 复制数据问题
- Lost connection to MySQL server at ‘reading initial communication packet’, system error: 111
- Lost connection to MySQL server at 'reading initial communication packet', system error: 111 (MySQL
- Lost connection to MySQL server at 'reading initial communication packet et system error:0
- MySQL error: 2013, “Lost connection to MySQL server at 'reading initial communication packet', syste
- Lost connection to MySQL server at ‘reading initial communication packet', system error: 0 mysql远程连接