Lost connection to MySQL server at 'waiting for initial communication packet'

Created:

2016-11-16 13:04:21 UTC

Modified:

2017-08-16 18:36:09 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Lost connection to MySQL server at 'waiting for initial communication packet'

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 11.x for Linux
  • Plesk 12.0 for Windows
  • Plesk 12.0 for Linux

Symptoms

Sites are opened very slowly or the errors below occur:

Link to database can not be established: SQLSTATE [HY000] [2013] Lost connection to MySQL server at 'waiting for initial communication packet', system error: 95
Link to database can not be established: SQLSTATE [HY000] [1040] Too many connections

Cause

The number of connections permitted is controlled by the max_connections system variable. If you need to support more connections, you should set a larger value for this variable.

Resolution

The current connections limit settings can be found using the following command:

# mysqladmin -uadmin -p`cat /etc/psa/.psa.shadow ` variables | grep 'max.*connections'
| max_connections | 100 |

Increase it in configuration file of MySQL /etc/my.cnf :

[mysqld]
set-variable=max_connections=150
set-variable=max_user_connections=20

Restart mysqld after to apply changings.

# /etc/init.d/mysqld restart

For more details check the MySQL reference manual "Too many connections"

Have more questions? Submit a request
Please sign in to leave a comment.