Changing MySQL db User Password Causes Connection Error


#1

Hi,

I’m trying to change the user passwords for my MySQL databases in the Dreamhost webpanel (under “My MySQL Databases”, selecting the user, and then entering the new password twice). However, for some reason, I’m unable to do so without causing an “Error establishing a database connection” when I visit the associated blogs and wiki online in a web-browser.

I have four dbs and two users:
[list]
[] user1 – with access to all four dbs
[
] user2 – with access to only one
[/list]

Changing the user password for “user2” does not impact the connection; changing it on “user1” means that I can’t visit any of the Wordpress blogs or my Mediawiki wiki through the course of normal web-browsing.

I had believed that the password controlled direct access to the MySQL db; I’m surprised that it has an impact on the functionality of the software.

I’m having trouble finding out where I’m screwing up (other than just leaving the password alone) in the Dreamhost troubleshooting wiki. All I can find is:

[list=1]
[]http://forum.dreamhosters.com/troubleshooting/7999-Change-password-for-mysql-user.htm
[
]http://wiki.dreamhost.com/MySQL
[/list]

Neither of which seems to help.

I’d be very grateful is someone could tell me how to fix this – but a link to the correct wiki page/ forum thread would also be appreciated. The password on User1 is pretty old by now and due for a change.

And, yes, this is all very embarrassing.


#2

You need to edit the wp-config.php file in your wordpress directory to use the same DB password you set.
The web panel you used sets the user password on the database server. Now you need to set the password on the client (website) end.

Your wiki should also have a config.php type file (or maybe it’s that “localsettings” file) with the db username and password.


#3

Brilliant. Thanks, Scott – I’ll give this a whirl, later tonight …


#4

[quote=“David_Platt, post:3, topic:53523”]
Brilliant. Thanks, Scott – I’ll give this a whirl, later tonight …[/quote]

And, by “tonight”, I apparently meant one month later. Seems to have done the trick, with only a few anxious minutes as I waited for the changes to take effect.

Thanks again! :slight_smile:


#5

I did the same thing, however, I am at a disadvantage because I know near nothing about editing php files. Could you please let me know the best way to go about this.


#6

Just open the file in any text editor. Are you on Windows? Notepad is preferred…

You want to look for the MySQL settings. They look like this:

[code]// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define(‘DB_NAME’, ‘DB name goes here’);

/** MySQL database username */
define(‘DB_USER’, ‘Username goes here’);

/** MySQL database password */
define(‘DB_PASSWORD’, ‘Password goes here’);;[/code]

Put your info inside the singe quotes. While you’re at it, you can also change the salts by going to the generator and pasting them here:

define('AUTH_KEY', 't`DK%X:>xy|e-Z(BXb/f(Ur`8#~UzUQG-^_Cs_GHs5U-&Wb?pgn^p8(2@}IcnCa|'); define('SECURE_AUTH_KEY', 'D&ovlU#|CvJ##uNq}bel+^MFtT&.b9{UvR]g%ixsXhGlRJ7q!h}XWdEC[BOKXssj'); define('LOGGED_IN_KEY', 'MGKi8Br(&{H*~&0s;{k0<S(O:+f#WM+q|npJ-+P;RDKT:~jrmgj#/-,[hOBk!ry^'); define('NONCE_KEY', 'FIsAsXJKL5ZlQo)iD-pt??eUbdc{_Cn<4!d~yqz))&B D?AwK%)+)F2aNwI|siOe'); define('AUTH_SALT', '7T-!^i!0,w)L#JK@pc2{8XE[DenYI^BVf{L:jvF,hf}zBf883td6D;Vcy8,S)-&G'); define('SECURE_AUTH_SALT', 'I6`V|mDZq21-J|ihb u^q0F }F_NUcy`l,=obGtq*p#Ybe4a31R,r=|n#=]@]c #'); define('LOGGED_IN_SALT', 'w<$4c$Hmd%/*]`Oom>(hdXW|0M=X={we6;Mpvtg+V.o<$|#_}qG(GaVDEsn,~*4i'); define('NONCE_SALT', 'a|#h{c5|P &xWs4IZ20c2&%4!c(/uG}W:mAvy<I44`jAbup]t=]V<`}.py(wTP%%');

(DO NOT use the above salts!!)
It’s always a good idea to update all of Wordpress’ security measures once in a while. Changing the salts will log you out if you are logged in to the WP dashboard.

More info is available here and here.


#7

mattesque

Thanks for the reply. I’d like to take a step back though. Opening the files is my problem. I’m sure this is simple, it is somewhat frustrating for me. I cannot edit the files through dreamhost…I can see the files but I cannot edit them. I have attempted to gain access to them using FileZilla and all attempts at this have failed too. Can you give me a bare bones tutorial on how to gain access to these files?

Greatly appreciated.

[hr]
Update…I got into filezilla.

[hr]
done and done. Thanks so much.


#8

Sorry – I missed your reply.
Glad you got it done though!