Error establishing a database connection
-
I have tried unsuccessfully to get my site up and running after mysteriously it went down. The best I have been able to do is to get WSOD and have done all the usual plugin and theme disabling. Using Phpmyadmin my passwords match up for my user. Webhost is nonresponsive and looking for any other possible scenarios explaining this error. Manual downgrade to 4.7.5 this morning from 4.8 as last resort with same issue. Using Debug it notes error in line 1538 and 1568 in wp-db but no idea what else is possible. Site has been like this for about 6 weeks so any help would be much appreciated!!
Chris
The page I need help with: [log in to see the link]
-
Let’s start with the basics — Is the database server up and running? Can you access your database via phpmyadmin from the hosting control panel? How is this site hosted?
Assuming the DB is up and what you say about phpmyadmin is correct, have you verified (and retyped) each of the DB_ related lines in wp-config.php?
Yes, I do think it is. I have phpmyadmin running on the webserver, not via control panel. The host is an Apple Xserve with each user assigned a folder that stores our websites individually.
WP-config I have been in and out of that unknown amount of times changing and re-changing with no results other than WSOD. So, yes, according to the info I was given I have it correct. But when I turn on debug it appears it is a pw issue.
Do you have any “funny” characters in the DB password? I’ve run into some cases where stuff that looks like it should be OK doesn’t work. Try resetting the DB password to something really basic, like a long string of lowercase letters with no special characters.
just to be sure – I have been editing the user password under wp-users. where can I look in phpmyadmin for the DB password? Maybe that’s where I am off base. I have been trying to use same password as my host supplied for DB access,…
Your WP password and your DB password are two different things (and should be different, too!).
Database passwords are set in phpmyadmin.
1. Select your database.
2. Click Privileges.
3. Find the user your use for your database in wp-config. Make a note.
4. Select the mysql database.
5. Select the “user” table.
6. Find the user from step 3 and click the EDIT link for that user.
7. Enter a new password for that user and set the dropdown to “Password” so it’s encrypted correctly.
8. Click “GO” and you’re done.
9. Enter the new password in wp-config.php as the DB password.I have just today installed phpmyadmin inside my folder on the server.
When I choose localhost, the volume above my database, I get a red ‘x’ No Privileges. Same when I choose Check Privileges in the detail column. I presume this means has to be done by webhost.
Is there a way for me to examine my DB password without them? I have sent multiple messages asking for help without a response over the last 6 weeks.
There’s probably an app or icon in your hosting control panel that lets you change your database passwords. Where are you hosting?
Did you edit password directly in the database? They should not be plain text passwords and should be encrypted with MD5 hash. You probably shouldn’t be editing anything in the database, as this will surely create more issues unless you know exactly what you are doing.
As @sterndata stated, user passwords and database passwords are completely different and you shouldn’t even be in the database for an issue like this. Your DB password is a MySQL database password that is created when you first create the database, usually from within your web host’s control panel.
Keith,
Correct, when my webhost setup my database I was given an PW which hasn’t, to my knowledge, changed in 3 years. I created my own WP user and I found on phpmyadmin today that password was different than the one set in my wp_config but no further progress after making them the same.Steve,
I am hosted on MacServe.net. No control panels or DB access as far as I can see.I suspect that an autoupdate in mid to late July to WP may have knocked my site down. I did try a downgrade to 4.7.5 with no luck and the usual plugin and theme disabling. If there is a way in phpmyadmin to view my DB password maybe that would help but don’t know that it is possible.
I am running out of time in front of a computer today – if I share my login info with you and either or both of you wants to see what you can do by tooling around with my site that would be a huge help. If not I understand it’s just that I have been trying erratically to fix and not making any progress so maybe a few minutes from one or both of you and perhaps the issue would be known or resolved.
I’m am 100% sure you mean well but please never offer credentials on these forums.
https://make.ww.wp.xz.cn/support/handbook/forum-welcome/#the-bad-stuff
Now for the why: The internet is a wonderful place full of very nice people and a few very bad ones. I’m sure everyone here is very nice however, by giving some ones keys to your house you are trusting they wont steal anything. Likewise the person who takes the keys is now responsible for the house FOREVER.
completely understood and appreciate your help so far.
Not sure how to check DB password with my setup or if even possible, but feel like that pw changing would be a unlikely event. Also not sure how to get my webhost to respond at this point.
Are there any other causes out there that I could try to resolve? I know there are a ton of possibles,…. when I matched my wp_config and wp_users pws up for a little bit I had WSOD but nothing more. Never thought it would be this tough to figure out a solution.
There is nothing to match up between wp-config and wp_users table in your DB. The password that is needed for wp-config is created within MySQL, usually from your hosting CP, using a tool such as phpMyAdmin. If you can access your DB using this tool (as you stated) then you can also create a new user such as ‘wordpress’ and create a PW for this user and give it all permissions.
The topic ‘Error establishing a database connection’ is closed to new replies.