当前位置:首页 > 开发 > 数据库 > 正文

ERROR 2013 (HY000): Lost connection to MySQL server at ‘reading authorization pa

发表于: 2014-10-21   作者:blackproof   来源:转载   浏览:
摘要: Discussion This error can happen when the client is attempting an initial connection to the server. If your connect_timeout value is set to only a few seconds, you may be able to resolve th

Discussion

This error can happen when the client is attempting an initial connection to the server. If your connect_timeout value is set to only a few seconds, you may be able to resolve the problem by increasing it.

Solution

Before increasing the value of connect_timeout, first determine its current value. This can be done by executing the following SQL statement:

SHOW VARIABLES LIKE 'connect_timeout';

+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| connect_timeout |  2    | 
+-----------------+-------+

Normally, setting this variable to ten seconds would be sufficient. You might want to set it to more than ten seconds if you have a very long distance or slow connection. You can determine whether you are experiencing this more uncommon cause by using the following SQL statement:

SHOW STATUS like 'aborted_connections';

This statement usually will return an empty set. However, if you have been experiencing aborted connections, the value will increase by one for each initial connection attempt that the server aborts.

To change this value of connect_timeout, you can use the SET statement. You will need SUPER privileges.

 

SET GLOBAL connect_timeout = 20;

ERROR 2013 (HY000): Lost connection to MySQL server at ‘reading authorization pa

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号