login community faq

I've tried to upgrade an existing PHP 5.2.x site running WordPress to PHP 5.4 by editing my .htaccess file. Unfortunately this immediately results in the dreaded

Error establishing a database connection

WordPress error.

Has anyone else experienced this? I have multiple WordPress installs and it happens on all of them. Why would upgrading the PHP version have any effect on the DB connection?

asked Mar 15 '12 at 20:51

ehough's gravatar image

ehough
1513


Some other PHP applications we have seen are unable to access the database after an upgrade to PHP 5.4, and have a specific error similar to the following:

1
2
3
4
cannot connect to MySQL 4.1+ using the old insecure authentication.
Please use an administration tool to reset your password with the command
SET PASSWORD = PASSWORD('your_existing_password'). This will store a new,
and more secure, hash value in mysql.user.

In order to rule out this possibility, try setting your password for your database again in the WebFaction Control Panel. This should perform the "SET PASSWORD" command as described above.

answered Mar 16 '12 at 01:26

ryans's gravatar image

ryans ♦♦
28411420

OK, I just added

< FilesMatch .php$>
    SetHandler php54-cgi
< /FilesMatch>

to my .htaccess file to prep for the support ticket and lo and behold - it works. The only difference was, this time I just used vim to edit the file. Wherease before I was using this plugin to manage changes to .htaccess.

Who knows. I'm just happy that it's working! Thanks your input and hope I didn't waste too much of your time.

answered Mar 15 '12 at 23:25

ehough's gravatar image

ehough
1513

Glad to hear you found the source of the problem.

(Mar 15 '12 at 23:32) johns ♦♦ johns's gravatar image

I spoke too soon! Was looking at a cached version of that page. The good news is that simply resetting the DB password from my control panel works fine. Onwards..

(Mar 16 '12 at 10:26) ehough ehough's gravatar image

Please submit a support ticket so we could look at the server and the account directly, you should not have a database error for simply upgrading.

answered Mar 15 '12 at 22:18

johns's gravatar image

johns ♦♦
340427

You might also want to try resetting your database password with what is set in the wp-config.php file just to be 100% sure it is correct.

(Mar 15 '12 at 22:50) johns ♦♦ johns's gravatar image

PHP 5.4 changed to mysqlnd (native driver) instead of libmysql, therefore OLD mysql (pre mysql 4.1) passwords are not supported with mysqlnd, simply change your db password as solution, make sure your mysql installation does not enforce old-style passwords (phpmyadmin passwd change function will let you choose which password style to use old or new)

answered Aug 21 '12 at 21:24

Lulu's gravatar image

Lulu
11

edited Aug 21 '12 at 21:26

Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×143
×7

Asked: Mar 15 '12 at 20:51

Seen: 2,558 times

Last updated: Aug 21 '12 at 21:26

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited