• Resolved Mis_Tral

    (@mis_tral)


    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?

Viewing 3 replies - 1 through 3 (of 3 total)
  • You might want to check with your hosting provider if your mysql details are correct.

    Thread Starter Mis_Tral

    (@mis_tral)

    Meaning which details more specifically? I installed a fresh WordPress instance, which was working fine before attempting to migrate onto it. Used the same mysql details during the migration as during the installation…

    Thread Starter Mis_Tral

    (@mis_tral)

    Appears that the problem has to do with DB corruption in the transfer process. I manually exported and imported the database, and the problem is now solved without any additional changes to DB user names, passwords, or permissions. haven’t checked the entire site yet to see if the files were all transfered as they should, but keeping my fingers crossed.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘“Error establishing a database connection” after restore to remote location’ is closed to new replies.