Database Connection Troubleshooting
A "Cannot connect to database" or "Error establishing a database connection" message means your application cannot communicate with its database server. This guide helps you diagnose and fix the most common causes on GoSiteMe hosting.
Common Causes
- Incorrect credentials: Wrong database name, username, or password in your configuration file.
- Database server is down: Rare on GoSiteMe due to high-availability infrastructure, but possible during maintenance.
- Connection limit reached: Too many concurrent connections exhausting the pool.
- Corrupted database tables: Crashed or corrupted tables preventing queries.
- Firewall blocking: IP-based restrictions preventing your application from connecting.
Step 1: Verify Credentials
Check your application's configuration file and compare the values against the database credentials shown in Dashboard → Hosting → Databases:
- WordPress: Check
wp-config.phpforDB_NAME,DB_USER,DB_PASSWORD, andDB_HOST. - Custom PHP: Check your connection file for the
mysqli_connect()or PDO parameters. - Node.js: Check your
.envfile or configuration module for theDATABASE_URL.
If any value is wrong, update it and save the file. The connection should work immediately.
Step 2: Check Database Server Status
Go to Dashboard → Hosting → Databases and look at the server status indicator. Green means operational; yellow means degraded; red means down. If the server is down, GoSiteMe's infrastructure team is automatically notified. Check the status page for updates.
Step 3: Check Connection Limits
Each GoSiteMe plan has a maximum concurrent database connection limit:
| Plan | Max Connections |
|---|---|
| Starter | 25 |
| Business | 100 |
| Enterprise | 500+ |
If your application exceeds the limit, connections are refused. Optimize your code to close connections promptly and use connection pooling. Monitor active connections in Databases → Monitoring.
Step 4: Repair Corrupted Tables
- Go to Databases → phpMyAdmin (or the Database GUI in GoCodeMe IDE).
- Select the affected database.
- Check the tables that may be corrupted.
- Click Repair Table from the dropdown.
- For WordPress, add
define('WP_ALLOW_REPAIR', true);towp-config.phpand visit/wp-admin/maint/repair.php.
Step 5: Check Firewall & Remote Access
If you are connecting from an external application, ensure your IP is whitelisted under Databases → Remote Access. GoSiteMe blocks external database connections by default for security. Add your server's IP address to allow access.
Contact Support
If none of these steps resolve the issue, contact GoSiteMe support with your domain name, the exact error message, and the time the issue started. Our team can check server-side logs for deeper diagnostics.