Database connection issues

21 views

Database connection issues

Overview

A database connection issue means your website (usually WordPress) cannot communicate with its database. Without this connection, your site cannot load content such as pages, posts, or settings.

Common Causes

  • Incorrect database details in wp-config.php
  • Database server is down or overloaded
  • Wrong database username or password
  • Corrupted database
  • Full disk space on hosting account

Step-by-Step Fixes

1. Check database credentials (most common issue)

  1. Log in to DirectAdmin File Manager
  2. Open: public_html/wp-config.php
  3. Check these lines:

DB_NAME DB_USER DB_PASSWORD DB_HOST

Make sure they match your actual database details in DirectAdmin.

2. Verify database in DirectAdmin

  1. Log in to DirectAdmin
  2. Go to: Account Manager → MySQL Management
  3. Check:
  • Database exists
  • User is assigned correctly
  • Password is correct

3. Repair the database

If the database is corrupted:

Enable repair mode

Add this line to wp-config.php:

define('WP_ALLOW_REPAIR', true);

Then visit:

yourdomain.com/wp-admin/maint/repair.php

Click:

  • Repair Database

⚠️ Remove the line afterward for security.

4. Check disk space

If your hosting is full:

  • Log in to DirectAdmin
  • Check disk usage
  • Remove unused files, backups, or emails

5. Check database server status

Sometimes the issue is temporary:

  • Database service may be overloaded
  • Server may be undergoing maintenance

Wait a few minutes and try again.

Important Notes

  • Even a small typo in wp-config.php will break your site
  • Always back up before making changes
  • Database issues often appear after migration or updates

Common Issues & Fixes

Website shows “Error establishing a database connection”

  • Check credentials in wp-config.php

Admin works but frontend does not

  • Possible plugin or theme conflict

Error started after moving site

  • Update database name and host settings

Need Help?

If you’re still experiencing database connection issues, our support team can check your configuration and restore your website access quickly.

Top