Jun 14 2007

wordpress database connection errors 373

Published by rob at 9:35 am under misc

I have just been setting up Wordpress on a few domain names while developing a few mini sites in my main line of work. I have had no problem in the past, usually bang up the install zip and put a few DB details in an away you go.

However this time I was getting persistant ‘cannot connect to database’ errors - referencing wp-db.php line 373 etc - all quite odd as the DB server was most certainly running.

It turns out the error was this one which is todo with the way mySQL handles auth (this one) which Wordpress did not say, rather going for the more general ‘Erm, no DB there mate‘ verdict.

So how to fix it? I did the following mySQL command:

UPDATE mysql.user SET Password = OLD_PASSWORD(’thenewpassword’)
WHERE User = ‘dbusername’;
FLUSH PRIVILEGES;

Note you cannot have the new password the same as the old one.

Dead easy when you know what the error is really, rather than a blanket ‘eh’ response.

Comments are closed at this time.