First Aid for Database Problems

When your website displays an error message regarding the database, it's usually due to one of three causes: incorrect login credentials, a corrupted table, or a hosting package limit. This guide helps you find and fix the error quickly yourself.

1. "Error establishing a database connection"

This is the most common error (especially with WordPress). It means that the website cannot reach the database server.

Solution Checklist:
  • Check Prefix: Have you included the cPanel prefix in your configuration file (e.g., wp-config.php)? The name must be user_dbname, not just dbname.
  • Password Test: Have you recently changed the database user password in cPanel? If so, you must also update it in the website configuration file.
  • User Privileges: Is the database user actually assigned to the database in cPanel under "MySQL Databases"?

2. "Table 'xyz' is marked as crashed and should be repaired"

This error occurs when a write operation was interrupted (e.g., by a server restart or a full disk quota). The data is usually still there, but the index is corrupted.

The Solution: Go to MySQL Databases in cPanel. Under "Repair Database," select your database and click the button. In 99% of cases, the website will be back online immediately.

3. "Too many connections"

Your website is attempting to open more simultaneous connections to the database than your package allows.

  • Cause: Poorly programmed plugins that don't close connections, or a sudden surge in visitors (or bot attacks) are often to blame.
  • Solution: Try deactivating unnecessary plugins or check your website for unusual traffic.

4. "Access denied for user..." during Import

This often happens when importing a SQL file via phpMyAdmin.

Solution: As described in our phpMyAdmin article, this is usually due to a CREATE DATABASE line in your SQL file. Delete this line using a text editor and try the import again.

5. Database is "Read-Only"

If you can see data but cannot save anything, your Disk Quota has likely been reached.

Tip: Check your Disk Usage in cPanel. If your web space is full, MySQL cannot write temporary files and will block changes.

Website still showing a blank screen despite these tips?
Don't worry, we won't leave you stranded. Open a support ticket and the CURIAWEB technical team will take a look!

Was this answer helpful? 1 Users Found This Useful (1 Votes)