WordPress Database Connection Error Checklist

halfbrain_logo512adminJune 13, 2026
3 lượt xem

WordPress Database Connection Error Checklist

The error establishing a database connection message usually means WordPress cannot connect to MySQL or MariaDB. This can be caused by wrong database credentials, a stopped database service, full disk, corrupted tables or server overload.

Common causes

  • Wrong database name, user or password in wp-config.php.
  • MySQL or MariaDB is stopped.
  • Disk is full.
  • Database server is overloaded.
  • Database user has missing privileges.
  • Recent migration changed credentials.

Checklist

  1. Check whether the error affects the whole site.
  2. Check database service status.
  3. Check disk usage.
  4. Check RAM usage.
  5. Open wp-config.php and verify database credentials.
  6. Check if the database exists.
  7. Check if the database user has privileges.
  8. Review recent migrations or password changes.
  9. Restart database service only if needed.
  10. Test the site again.

Final check

The site is recovered when MySQL is active, credentials are correct, disk is not full and WordPress can load both frontend and wp-admin.

Checklist Type Troubleshooting
Level Beginner
Risk Level High Risk
Estimated Time 20–60 minutes

When to Use This Checklist

Use this checklist when WordPress shows Error establishing a database connection on a VPS or hosting environment.

Required Tools

SSH access, wp-config.php, MySQL or MariaDB access, database credentials, VPS terminal

Before You Start

Do not reset database passwords before checking wp-config.php and database service status.

Structured Checklist Steps

  1. Confirm the whole site is affected.
  2. Check MySQL status.
  3. Check disk usage.
  4. Check RAM usage.
  5. Verify DB_NAME in wp-config.php.
  6. Verify DB_USER.
  7. Verify DB_PASSWORD.
  8. Verify DB_HOST.
  9. Check database user privileges.
  10. Restart database service only if needed.

Rollback Plan

If credential changes break the site, restore the previous wp-config.php values or restore the database user password from your saved credentials.

Common Mistakes

  • Changing database password without updating wp-config.php.
  • Ignoring full disk.
  • Restarting MySQL repeatedly without checking logs.
  • Using the wrong database name after migration.
  • Deleting database users by mistake.

Related Commands

sudo systemctl status mysql
df -h
free -h
grep DB_ wp-config.php
mysql -u db_user -p
sudo systemctl restart mysql

Share:

Disclaimer: The guides, checklists, commands, and examples on HalfBrain.net are provided for educational and operational reference only. Server environments, hosting providers, software versions, security settings, and WordPress configurations can vary, so you should always review commands before running them on your own system. We do our best to keep the content accurate and useful, but we cannot guarantee that every command, configuration, or recommendation will fit every environment. Always back up your website, database, and server configuration before making changes. HalfBrain.net is not responsible for data loss, downtime, security incidents, misconfiguration, or other issues that may result from applying the information on this website. Use the material at your own discretion.

Leave a Reply

Your email address will not be published. Required fields are marked *