Website does not work after migration: Unable to connect to database server!

Created:

2017-03-16 13:49:43 UTC

Modified:

2017-08-08 13:21:41 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Website does not work after migration: Unable to connect to database server!

Applicable to:

  • Plesk for Linux

Symptoms

Website does not work after migration from another Plesk server:

Unable to connect to database server!

The following error can be found in /var/www/vhosts/example.com/logs/error_log:

[Thu Mar 16 14:19:18.540279 2017] [cgi:error] [pid 25447] [client 203.0.113.2:33770] AH01215: PHP Warning:  mysql_connect(): Access denied for user 'dbuser'@'localhost' (using password: YES) in /var/www/vhosts/example.com/httpdocs/inc/xtc_db_connect.inc.php on line 24, referer: http://203.0.113.2:8880/smb/web/overview/id/d:93

The database does not show in Plesk GUI, nor is registered in Plesk:


  mysql> select * from data_bases where name='example';
  
Empty set (0.00 sec)

But it exists on the MySQL server:


  mysql> show databases like "%example%";
  
+----------------------------+
| Database (%example%) |
+----------------------------+
| piwik_example              |
| example                    |
+----------------------------+

Cause

The database did not migrate because it was not registered in Plesk on the source server.

Resolution

Contact the website developers to re-create the database and necessary credentials on the target server manually.

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