• Moving a WordPress VM instance, this error, “Error Establishing a Database Connection on Local Server” is presented. Verified that the database credentials are working (from command line, accessing mysql -u -p works fine), and randomly checking some of the tables appears to be fine too.

    Moreover, setting the define(‘WP_ALLOW_REPAIR’, true); setting and navigating to site/wp-admin/maint/repair.php also results in the “Error Establishing a Database Connection on Local Server” error.

    This particular scenario is not described anywhere. Any tips would be much appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,

    You can use this command, mysqldump -u root -p --default-character-set=utf8 --result-file=resultfile.sql databasename

    And then you will be able to setup.

    Thanks,

    Those may happen out of ordinary matters. Use a basic PHP script to check MySQL connection. Check mysqld error log file. Test wp-config.php with root user of MySQL. Default charset should be exactly like your previous setup.

    Thread Starter llorban

    (@llorban)

    Unfortunately mysqldump even with the utf8 encoding did not make a difference.

    The whole VM was cloned so everything should be identical between the systems.

    Running

    mysqlcheck -o wordpress -u wordpress -p
    Enter password:

    produces the following error on some of the tables:

    wordpress.wp_2_comments
    note : Table does not support optimize, doing recreate + analyze instead
    error : Invalid default value for ‘comment_date’
    status : Operation failed

    Dion

    (@diondesigns)

    If you cloned the VM while MySQL was running, it’s possible (actually pretty likely) that any database containing an InnoDB/Aria table is corrupted.

    If you have the ability to do so, wipe out the clone you created, then stop MySQL and re-clone the VM. Otherwise you’ll need to manually export the databases to the cloned VM.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Unusual context: Error Establishing a Database Connection on Local Server’ is closed to new replies.