Database Troubleshooting in cPanel: First Aid for Common Errors
If your website suddenly displays a database error message, the cause is often incorrect login credentials, missing user privileges, corrupted tables, or reached resource limits. Especially with WordPress, Joomla, Laravel, or other database-driven applications, a minor configuration error can prevent the website from loading correctly.
This guide shows you the most common database issues in cPanel and explains how to systematically check and resolve the main errors.
1. "Error establishing a database connection"
This message appears particularly frequently on WordPress websites. It means that the website cannot establish a successful connection to the MySQL or MariaDB database.
- Check database name: In cPanel, the database name usually consists of the cPanel username and the actual database name, for example
user_dbname. Check whether this full name is entered in your configuration file. - Check database user: The database user also typically contains the cPanel prefix, for example
user_dbuser. - Check password: If the password of the database user was changed in cPanel, it must also be updated in your website's configuration file, for example in
wp-config.phpfor WordPress. - Check user assignment: In cPanel, open the MySQL Databases section and check whether the database user is assigned to the correct database.
- Check privileges: The user needs the appropriate permissions for the database. For typical CMS installations, full privileges are usually required.
For WordPress, the relevant login credentials are located in the wp-config.php file. In particular, DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST should be checked there.
2. "Table 'xyz' is marked as crashed and should be repaired"
This error message indicates that a database table is corrupted or should be repaired. This can occur, for example, after interrupted write operations, faulty imports, or storage issues.
- Log in to cPanel.
- Open the MySQL Databases section.
- Look for the Repair Database section.
- Select the affected database.
- Click on Repair Database.
After the repair, you should visit your website again and check if the error message has disappeared. If the error occurs repeatedly, you should also check whether sufficient storage space is available and whether a plugin, script, or import process is corrupting the table again.
3. "Too many connections"
The message "Too many connections" means that too many simultaneous connections to the database have been opened. The website is then temporarily unable to establish any new database connections.
- Possible cause: A high surge in visitors, bots, poorly optimized plugins or scripts that do not close database connections properly.
- Typical for CMS websites: WordPress plugins, shop extensions, statistics tools, or external interfaces can generate an unnecessary number of database queries.
- First measure: Temporarily disable plugins or extensions that are not required and check whether the website behaves stably again afterwards.
- Further check: Check your website logs and visitor statistics for unusually high traffic or suspicious IP addresses.
4. "Access denied for user …"
The error message "Access denied for user …" means that the database user used is not allowed to connect or does not have the required permissions.
In this case, check the following points:
- Is the database user spelled correctly?
- Was the full cPanel prefix used, for example
user_dbuser? - Is the password correct?
- Is the user assigned to the correct database?
- Does the user have the necessary permissions for this database?
5. "Access denied" during import via phpMyAdmin
When importing an SQL file via phpMyAdmin, an "Access denied" message can also occur. This is often because the SQL file contains commands that are not allowed to be executed on a web hosting package or do not match the existing database structure.
A common case is a line like:
CREATE DATABASE databasename;
If you have already created a database in cPanel, the SQL file should normally only be imported into this existing database. In this case, remove the CREATE DATABASE line with a suitable text editor and try the import again.
Further information can be found in our article on phpMyAdmin in cPanel.
6. Database is read-only or changes are not saved
If content is displayed but no new data can be saved, this may indicate a storage space issue. If the storage quota of your hosting package is exhausted, databases, temporary files, or CMS caches may no longer be written correctly.
7. Blank page or HTTP 500 error after database changes
A white page or an HTTP 500 error can occur after changes to database data, login credentials, or configuration files. The actual cause is not always displayed directly in the browser.
In this case, check:
- whether the database login credentials are correct,
- whether the website configuration file was saved without errors,
- whether a plugin or theme is causing an error after the change,
- whether further details are visible in cPanel under Errors or in the error logs.
Summary: How to proceed with database errors
- First, check the database name, username, and password.
- Check whether the database user is assigned to the correct database.
- Repair corrupted tables via MySQL Databases in cPanel.
- Check storage space, plugins, visitor traffic, and error logs.
- When importing SQL, remove problematic commands like
CREATE DATABASEif the database already exists in cPanel.
Does your website still show a database error message or remain blank?
The CURIAWEB technical team will be happy to support you with the analysis of your cPanel hosting.