If database settings have not been configured properly for software, errors can occur. The two most common errors are:
In this article we'll go through the most common reasons for each of these errors and how to resolve them.
To resolve this error, check the following settings in your configuration file and correct as needed. The location of the configuration file depends on the program. You can find a list of the more common programs and their configuration files in the link below.
Locating program configuration files
Once you know where the particular file is located, you can edit your configuration file with the cPanel File Manager:
Hostname | localhost |
---|---|
Database Name | Full database name. This has two parts, the prefix will be your cPanel username and the part after the underscore will be the database name. Example: If your cPanel username is userna5 and the database name is db1, then you would enter userna5_db1 |
Database UserName | Full database username. This has two parts, the prefix will be your cPanel username and the part after the underscore will be the database username. Example: If your cPanel username is userna5 and the database user us dbuser then you would enter userna5_dbuser |
Password | This is the password for the database user assigned to the database. |
If needed, you can change the password for your database user.
Once you have corrected the database settings as needed, refresh your website in your browser to make sure the error has been resolved.
This error is most often caused by using the cPanel settings (cPanel username and password) in the configuration settings instead of the specific database username and password. In the following example, the cPanel username is whhsup5, whereas the full database username is whhsup5_mydbuser.
If the database settings are set to use the cPanel usename and password instead of the full database user and its password, the following error will appear if and when you ever change your cPanel password:
Checking the file that contains the configuration settings, you may see something similar to the following:
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'whhhsup5');
define('DB_PASSWORD', '[previous cpanel password]');
define('DB_DATABASE', 'whhsup5_mydatabase');
define('DB_PREFIX', '');
You will want to change the settings to use the full database usrname and password instead. Fortunately, this is easy and quick to fix. Edit your configuration file and edit the DB_USERNAME variable to use the database username and the DB_PASSWORD variable to use password for that database user.
If you did not create a database user when you created your database, you will want to create a new database user and assign it to your database.
Once you have edited your configuration file, the database settings should look similar to:
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'whhsup5_mydbuser');
define('DB_PASSWORD', '[new database user password]');
define('DB_DATABASE', 'whhsup5_mydatabase');
define('DB_PREFIX', '');
Refresh your website in your browser and your error should be resolved.
If you have any trouble resolving either one of these errors, please feel free to contact our Support Department for assistance.
Email: | support@WebHostingHub.com | Ticket: | Submit a Support Ticket |
---|---|---|---|
Call: |
877-595-4HUB (4482) 757-416-6627 (Intl.) |
Chat: | Click To Chat Now |
We value your feedback!
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
new! - Enter your name and email address above and we will post your feedback in the comments on this page!