Wordpress database permissions messed up, db possibly corrupted (?)

Status
Not open for further replies.

chatterbox42

Member
Messages
38
Reaction score
2
Points
8
I was trying to follow the instructions in the x10 blog on securing WordPress by changing the database name (in an existing installation), but I seem to have messed something up. I got an "Error establishing a database connection" message when I tried to load the site, panicked and changed everything back, but I still get the same error.

The Wordpress admin page shows this additional message:

Error establishing a database connection

This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at localhost. This could mean your host's database server is down.

  • Are you sure you have the correct username and password?
  • Are you sure that you have typed the correct hostname?
  • Are you sure that the database server is running?
--

Since everything was changed back to the original settings I figured something else got altered.

I searched around a bit and the most logical explanation seems to be that the user permissions were reset, but all the suggestions I find involve simply clicking on the username (in the MySQL user list) and checking the relevant boxes, but when I select the user, the only option I get is to change the password. I couldn't find anything at all involving setting permissions (assuming this is even the problem).

Is this something I can sort out from my end or should I open a support ticket?

Edit: I got the permissions sorted but I'm still getting the error. I tried updating the database user password - to see if it was an issue - and it won't recognize the old one, even though I'm copying it directly from the config file.
 
Last edited:

sebandf2

Member
Messages
35
Reaction score
0
Points
6
Are you using the cPanel x3? if so click the on the mysql user and you can then change permissions for that user
 

chatterbox42

Member
Messages
38
Reaction score
2
Points
8
Oh, thanks. I was just editing to say I finally figured that part out. It seems to be an entirely different issue.
 

caftpx10

Well-Known Member
Messages
1,534
Reaction score
114
Points
63
Have you entered your MySQL user, password and database name in the config.php file? Is the host set to 'localhost'? Is the user linked to the database?
 

chatterbox42

Member
Messages
38
Reaction score
2
Points
8
Yep, I did everything in the instructions, then I UNDID everything (reverted to original name and used 'undo' in the file editor to restore the config.php file to the original) and saved.

What do you mean exactly by 'linked to the database'? I had created a new user when I made the initial change, but I deleted it on reversion. The original still wasn't working (ie still resulting in a connection error), so one of the last things I did before posting here was delete it and create a new user with the same name. Is that likely to be the issue?


Edited to add: Now when I click on the existing user and try to change the password it asks me to confirm which user, but the options in the pop-up are only the user I created for the rename and subsequently deleted, and an empty option that looks like this: <>

Right before this happened I had attempted to change the password and it said it didn't match, but in that attempt when it asked for confirmation, the correct user was listed below the one I had deleted. It's now been replaced by this - <>
 
Last edited:

caftpx10

Well-Known Member
Messages
1,534
Reaction score
114
Points
63
First off, you'll need to add a user to the database like so.
j2W0tG9.png

After that, you should be able to set the permissions to whatever (make sure the correct ones are selected) and apply. The selected username and database should now both be associated with each other.
RRSuDYg.png


Oh- and if you do continue to have the issue, which server is your site hosted on? Ex. xo5
 
Last edited:

Dead-i

x10Hosting Support Ninja
Community Support
Messages
6,084
Reaction score
368
Points
83
Hi,

I'm only seeing one database user, so I'm not so sure where you are seeing two. In any case, it looks like the user that your WordPress installation is attempting to connect with exists, but the password is incorrect. If you know the password to this user, you can change your wp-config.php file accordingly. If you're not sure what the password is, you can safely delete the MySQL user from the "MySQL Databases" section of cPanel, re-create it, and re-assign it.

Please let us know if you have any further questions. ;)

Thank you,
 

chatterbox42

Member
Messages
38
Reaction score
2
Points
8
Dead-i - thank you SO much. I just re-did everything and it worked. It looks like I was missing the step 'add user to database' after I created the new user. (I thought as long as it was in the user list it meant it was already added. Oops!)

caftpx10 - thank you too for your assistance. All fixed now.
 
Status
Not open for further replies.
Top