Hey Everyone

ugclanx1

New Member
Messages
0
Reaction score
0
Points
0
Hey guys, so im fairly new to this. And in advanced i apoologize if this is in the wrong section for help, didnt really know where to put it.

Anyways, me and a friend made a website for a gaming community we've created. However i no longer wanted my partner a part of the clan. I just changed the password for the x10 hosting account we used. But now when i go to login to the forums we created it is giving me this error:

SQL ERROR [ mysqli ]

Access denied for user 'ugclanx1'@'localhost' (using password: YES) [1045]

An sql error occurred while fetching this page. Please contact an administrator if this problem persists.

What should i do?
 

Anna

I am just me
Staff member
Messages
11,758
Reaction score
586
Points
113
First of all it is not good practice to use your cPanel username/password for mysql access, which by the look of it is what you are doing. This means that if you changed the password for your account you'll need to change the password for mysql in the config file of your script to match that new password.

It is recommended that you create a database user in cPanel and add it to the database, also done in cPanel under "MySQL Databases", same place as you created the database.

Also please note that support questions should be directed through the ticket system that you can find in your account portal.
 

ugclanx1

New Member
Messages
0
Reaction score
0
Points
0
Hey, thanks for the help. I've changed the password back to the previous one so people can access my forum website. However, how exactly can i change my SQL Database password? When i go into that section, there are no options to do anything to my current database besides deleting it.
 
Last edited:

Anna

I am just me
Staff member
Messages
11,758
Reaction score
586
Points
113
The password is linked to the username you connect to the database with, not the database itself.

If you change password for that username, as you did, you would need to go to filemanager and find the configuration file for your script of choice, often called "config.php" and located in the scripts root folder (in other words where the index.php for that script is located).

Took a look at your site, appears you are using phpBB as forum soft, so the correct file would indeed be config.php in your case. Open the file with the code editor in the filemanager and find this row:
Code:
$dbpasswd = 'currentpassword';

change the 'currentpassword' to 'newpassword'. You'd need to do this EVERY time you decide to change your cPanel password since you use that for mySQL access.

Better practice is to create a separate database user in cPanel, and add it to the database with proper permissions. If you chose to do this, which I highly recommend, you would need to change the following as well:
Code:
$dbuser = 'curusername';

change 'curusername' to 'cpanelusername_databaseusername', where database username is the one you set in cPanel, and cpanelusernam would be what you use to login to cpanel.
 

ugclanx1

New Member
Messages
0
Reaction score
0
Points
0
Thanks so much again, i changed the password and no longer have any problems with my old forum partner. I appreciate the help.
 

ugclanx1

New Member
Messages
0
Reaction score
0
Points
0
Sorry for being such a bother, i tried to get the ticket thing but it wasnt working. Anyways, i now have this error out of the blue and don't know how to fix it.


SQL ERROR [ mysqli ]

Can't connect to MySQL server on '127.0.0.1' (111) [2003]

An sql error occurred while fetching this page. Please contact an administrator if this problem persists.
 

Anna

I am just me
Staff member
Messages
11,758
Reaction score
586
Points
113
mysql server had a temporary halt, should have been sorted pretty quick after it went down.
 
Top