There was a problem loading the comments.

I am unable to connect to database server.

Support Portal  »  Knowledgebase  »  Viewing Article

  Print

You must be getting a screen displaying 'Error establishing databse connection' as above or a warning as shown below:

 

Warning: mysql_connect(): Access denied for user: 'user1_name1@localhost' (Using password: YES) in /home/ukhost/public_html/db.php on line 216

The above warnings indicate that the website database exists in cPanel, but the website cannot communicate with it. To resolve this issue, we need to perform the steps listed below:-

Create a new user database and attach that database to the one in which we are facing issue.

We need to create the new user and then attach this user to the erroneous database. Steps for creating the new user are as follows:

1. Log into the cpanel and select MySQL Database.

2. Add users under MYSQL USER tab.

3. Under Add User To Database, choose the user you just created from the User drop-down menu.

4. Choose the name of your database from the Database drop-down menu and click Add.

5. Change the database username in your database configuration file and then check the website.


Share via
Did you find this article useful?  

Related Articles


Self-Hosted Help Desk Software by SupportPal
© Host4u Limited