MySQL service does not work: PHP Warning: mysql_connect()

Created:

2016-11-16 12:56:46 UTC

Modified:

2017-08-08 13:33:19 UTC

0

Was this article helpful?


Have more questions?

Submit a request

MySQL service does not work: PHP Warning: mysql_connect()

Applicable to:

  • Plesk 12.0 for Windows

Symptoms

MySQL service does not work. Websites are not available:

PHP Warning:  mysql_connect():  in C:\\Inetpub\\vhosts\\example.com\\httpdocs\\wp-includes\\wp-db.php on line 1382

Huge number of network connections to MySQL service:

C:\\Users\\Administrador>netstat -a -n | find /c "3306"
19436

Cause

MySQL connections are not closed by website code

Resolution

  1. Create the following registry key to limit time for connections in TimeWait status:

    HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters

    Value Name: TcpTimedWaitDelay
    Data Type: REG_DWORD
    Value: 30
  2. Reboot the server

  3. Contact website developer to debug potential errors that may stop the execution of closing the MySQL connection

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