Quick search
Search

Database Connection Error

Database Connection Error.
A database connection error may occur during site migration or when installing a CMS without installation support.

Issues and resolving DB error connect.

1. MySql user not assigned or not created


Click "MySQL® Databases" in your cPanel.

Check if the user is created and assigned to your database.

Add User to Database. If the database username is not listed, you need to assign a user using the "Add User to Database" form located at the bottom of the page.

If the user has not been created, create the user and add it to the database.

2. Database connection data is incorrect

Check the data of the database connect in MySql connection file.
For example "wp-config.php" in WordPress or "configuration.php" for Joomla.

For example, on a WordPress site, You need to open the file "config.php" for editing.

Connecting lines

define('DB_NAME', 'database name');
define('DB_USER', 'user login');
define('DB_PASSWORD', 'user password');
define('DB_HOST', 'localhost');

Important:
DB_HOST - must be localhost

DB_NAME - you can check the Database name in "MySQL® Databases"


DB_USER - you can check the Database username in "MySQL® Databases"
If the database name and username are correct but the connection error persists, try resetting the password.
In the following line: define('DB_PASSWORD', 'user password');
Copy the password and re-save it in cPanel > MySQL® Databases > Current Users.

If the connection error persists, please create a support ticket in your Client Area under the "Technical Support" section.