Fix WordPress “Error establishing a database connection”
- 20.02.2026 00:57
-
- database
- hosting
- mysql
- troubleshooting
- wordpress
The WordPress message “Error establishing a database connection” means the website cannot connect to its MySQL/MariaDB database. On GARMTECH hosting this is usually caused by an incorrect database password after a migration, or by deleted/changed database users.
Step 1 – Quick checks
- Reload the page and try again in a few minutes (temporary overload can happen).
- Check if other websites in the same hosting subscription work. If everything is down, check Plesk first.
- Make sure you have free disk space (a full account can cause database issues).
Step 2 – Verify database credentials in Plesk
- Log in to Plesk.
- Go to Databases and find the database used by the website.
- Check the database user. If you are not sure, open your website’s
wp-config.phpin Plesk File Manager and look for:DB_NAMEDB_USERDB_PASSWORDDB_HOST(on Plesk it is usuallylocalhost)
- If you suspect the password is wrong:
- In Plesk → Databases → open the database user and set a new password.
- Update
DB_PASSWORDinwp-config.phpto the same value.
Step 3 – Check if the database is reachable
- In Plesk → Databases, click phpMyAdmin for the same database.
- If phpMyAdmin opens and tables exist, the database itself is OK – the problem is usually credentials in
wp-config.php.
Step 4 – If the website was moved/migrated
- Make sure the database was imported into the correct database.
- Make sure the database user has permissions for that database.
- If the old host used a different DB host (not
localhost), updateDB_HOSTto match Plesk (usuallylocalhost).
Step 5 – Restore from a backup
If the database is corrupted or missing tables, restore the website or database from a Plesk backup (Backup Manager) or from your own backup file.
Related Articles
Comments
Add Comment