Database connection error (2): Could not connect to MySQL- Joomla Issue

While accessing the Joomla site I was getting the error as "Database connection error (2): Could not connect to MySQL"

Solution -

1. Database Credentials in 'configuration.php' file -

Please make sure that database credentials that is database username or database password which you're using in your site's configuration file is correct.

2. Below are the field which you'll need to check in 'configuration.php' file-

public $user = 'MySQL_database_username';
public $password = 'MySQL_database_password';

3. If you are not sure about the MySQL database details please reset the password and give a try. In cPanel you can reset it from -
cPanel >> MySQL Databases >> Current Users >> Change Password

It fixed my issue!

Was this answer helpful?

 Print this Article

Also Read

How to reset WordPress administrator password?

You can follow below steps to reset the WordPress administrator password - 1. Login to cPanel2....

How to resolve the issue of WordPress site which downloads PHP files instead of parsing after cPanel migration?

After migrating the WordPress site on the cPanel server, the website was not loading, it was...

How to enable Hot Link Protection in cPanel?

To avoid other sites to use your website's bandwidth, you can enable the hot link protection....

How to Specify the exact time to run a backup on cPanel server?

How to Specify the exact time (hour) to run a backup on cPanel server? Solution :- By default,...

How to limit email recipients on exim to 10 email addresses?

You might come under a situation where your client expects you to secure their mail server and...

Powered by WHMCompleteSolution