How to Fix WordPress Error Establishing a Database Connection

The Error Establishing a Database Connection message means WordPress can't connect to your MySQL database. This usually comes down to incorrect credentials or a database server issue. Here's how to troubleshoot it on your dotCanada hosting account.

Step 1: Check Your wp-config.php Credentials

Connect via FTP and open wp-config.php in your site's root directory. Verify these four values are correct:

  • DB_NAME - the name of your database
  • DB_USER - the database username
  • DB_PASSWORD - the database user's password
  • DB_HOST - usually localhost on dotCanada shared hosting

Step 2: Verify the Database Exists

Log in to your cPanel account and navigate to MySQL Databases. Confirm that the database name listed in wp-config.php exists, and that the database user is assigned to it with All Privileges.

Step 3: Test the Password

If the database and user exist, the password may be wrong or out of date. In cPanel under MySQL Databases, you can update the user's password and then update wp-config.php to match.

Step 4: Check for Server Issues

Occasionally, the database server itself may be temporarily unavailable. If your credentials are correct but the error persists, contact our support team and we can check the status of your database server and restore access quickly.

100% Satisfaction Guarantee

We're so confident you'll love dotCanada that we offer a 30-day money-back guarantee. Not satisfied? Get a full refund, no questions asked.

Ready to Get Started?

Join thousands of Canadian website owners who trust dotCanada for reliable, fast web hosting.

Get Started Today