Troubleshooting

How do I fix "Error establishing a database connection"?

The message "Error establishing a database connection" means your site (usually WordPress) cannot talk to its database. The site's files are fine; the link to the database is the problem.

Most common causes and fixes:

  1. Wrong database credentials. Check wp-config.php (via File Manager at my.dirhamaday.ae) for DB_NAME, DB_USER, DB_PASSWORD and DB_HOST. These must exactly match the database and user in the panel's MySQL Databases tool. A recently changed database password is a frequent culprit.
  2. DB_HOST value. On our servers this is normally localhost. Confirm it is correct.
  3. Corrupted database. If credentials are right, the database may need repair. In WordPress, add define('WP_ALLOW_REPAIR', true); to wp-config.php, then visit yourdomain.ae/wp-admin/maint/repair.php. Remove the line afterwards.
  4. Resource limits. A traffic spike or a heavy query can briefly exhaust database connections.

If you have just migrated the site, this error usually means the database was not imported or the credentials in wp-config.php point to the old host.

If you cannot resolve it, contact our 24/7 UAE team on WhatsApp +971 58 553 6767 or support@dirhamaday.ae. We can check the database, credentials and server status and get you reconnected.

Still need a hand? Our UAE-based team is here 24/7.

Related articles

My website is down, what do I do?How do I fix a 500 Internal Server Error?What causes 502 and 504 gateway errors?How do I fix a 403 Forbidden error?Why am I getting a 404 Not Found error?