“Error establishing a database connection” after restore to remote location
-
Trying to migrate a multi-site. A couple of notes:
1. Although the plugin claims to update wp-config.php during the last step, it failed to update the site URL in my case, although these credentials (for the target URL, target DB, etc.) were provided during the process.
2. After the restore to remote location process completion (and manually updating the wp-config), the new/remote site gives “Error establishing a database connection” error.
2.1. I have attempted to change the DB pwd for the existing user, and create a new DB user and enter the details in both wp-config and installatron. Nothing, still same error.
2.2. I have attempted to repair DB in phpmyadmin. No effect, still the same error.
2.3. Diagnostics by creating a checkdb.php file with the code<?php
$test = mysql_connect(‘localhost’, ‘db_user’, ‘db_password’);
if (!$test) {
die(‘MySQL Error: ‘ . mysql_error());
}
echo ‘Database connection is working properly!’;
mysql_close($testConnection);Give output “Access denied for user ‘db_user’@’localhost’ (using password: YES) in /home/…/domains/…/public_html/checkdb.php on line 2 MySQL Error: Access denied for user ‘db_user’@’localhost’ (using password: YES)”
Any thoughts as to what may be causing this?
All of the tables that need to be present in the DB are present. I have checked in MySQLManagement (using DirectAdmin) the permissions of the DB user which credentials are in the wp-config file, and the permissions are listed as available there. What else should I check?
- The topic ‘“Error establishing a database connection” after restore to remote location’ is closed to new replies.