Error Establishing Database Connection

The Error Establishing a Database Connection is exactly what it sounds like: your WordPress site can no longer communicate with its MySQL database. Since all your content, settings, and users are stored in the database, your site goes completely offline.

Common Causes

  • Incorrect database credentials in your configuration file.
  • Corrupted WordPress database.
  • Unresponsive database server (rare on Hosticky NVMe SSD servers).

How to Fix It

1. Check Your wp-config.php Credentials

90% of the time, this error happens after migrating a site or changing a password. Open your wp-config.php file using the Hosticky File Manager and verify these four lines match your actual database details:

define( 'DB_NAME', 'your_database_name' );
define( 'DB_USER', 'your_database_user' );
define( 'DB_PASSWORD', 'your_password' );
define( 'DB_HOST', 'localhost' ); // Usually localhost on Hosticky

2. Repair the WordPress Database

If your credentials are correct, your database tables might be corrupted. You can ask WordPress to attempt an automatic repair. Add this line to your wp-config.php:

define( 'WP_ALLOW_REPAIR', true );

Then, visit yoursite.com/wp-admin/maint/repair.php and click "Repair Database". Important: Remove the line from wp-config.php after you finish!

Still seeing the error? Open a support ticket and our Hosticky technicians will check the MySQL server status for you immediately.

War diese Antwort hilfreich? 0 Benutzer fanden dies hilfreich (0 Stimmen)