Database connection issues
21 viewsDatabase 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)
- Log in to DirectAdmin File Manager
- Open:
public_html/wp-config.php - 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
- Log in to DirectAdmin
- Go to: Account Manager → MySQL Management
- 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.phpwill 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.