Error: Connection to the database server has failed because of network problems: Try to establish connection failed Solved

This Windows tutorial shows how to solve the “Error: Connection to the database server has failed because of network problems: Try to establish connection failed” by resetting the MySQL administrator’s password in Windows.

The following tutorial is applicable only for the following Plesk Panel versions on Windows Virtual Private Servers & Windows Dedicated Servers:

  • ·         Parallels Plesk Panel 11.x for Windows
  • ·         Parallels Plesk Panel 10.x for Windows

Symptom of the Error:

When trying to manage customers’ MySQL databases it may create the following error and display MySQL server in red color under the Tools & Settings  >> Database Servers screen:

Error: Connection to the database server has failed because of network problems: Try to establish connection failed

Cause of the Error:

The above error might cause due to the wrong MySQL server administrator password stored by the Plesk.

Solution for the Error:

In order to fix the above MySQL error and successfully reconnect the Plesk Panel with MySQL server, you need to follow the steps given below:

Step 1: Using the Plesk Services Monitor tray utility, first make sure you have Stopped the MySQL server from running on the port 3306. Please note that, you should only stop the MySQL server and not the Plesk SQL Server.

Step 2: Now open the MySQL configuration file from the location %plesk_dir%\Databases\MySQL\Data\my.ini, and simply add the line “skip-grant-tables” & “skip-networking to the [mysqld] section.

Adding the “skip-grant-tables” line enables anyone to connect MySQL without a password with full access and the “skip-networking” line prevents remote clients from connecting to the server.

Step 3: Once the file is edited, just start the MySQL server.

Step 4: Now, you need to log in to the MySQL without the password, for that run the following mysql.exe file.

%plesk_dir%\Databases\MySQL51\bin\mysql.exe

Step 5: Enter a new password for the MySQL administrator:

UPDATE mysql.user SET Password = PASSWORD('newpassword') WHERE User = 'admin';

Make sure to replace the “PASSWORD” with your new password and save the file.

Step 6: Now, again go and edit the MySQL configuration file and remove the “skip-grant-tables” line from the file and simply Restart the Service.

Step 7: Log in to the Plesk Panel Interface, go to the Tools & Settings >> Database Servers and replace the password for the database server to the one you have used in the Step 5.

Now, Plesk will successfully re-establish the connection to the server without any errors.