php5.3 and mysqlnd authentication issue

Upgrading a system is always fun and full of headaches, my last one was with the new mysqlnd extension from php 5.3. I cannot manage to connect to mysql from symfony.

I always get:

SQLSTATE[HY000] [2000] mysqlnd cannot connect to MySQL 4.1+ using old authentication

After struggling a while on google, I cannot find any solution. So I went back to the RTFM idiomatic expression.

It is what I found:

  • php 5.3 now use a native extension to use mysql : mysqlnd
  • my database credential was old (4 years old maybe) and still use the old mysql authentication
  • mysqlnd needs the new 41bytes password

So the problem was easy to solve, just reset the user's password.

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('mypassword');

References:

Comments

Fabio Varesano
about 1 month after
Thanks dude! I also was having this problem after my Arch Linux system got updated to php 5.3.. You saved me some headache.. Thanks for sharing.
Eric Pasquier
about 1 month after
Merci ! It fixed my problem immediately, but after half of a day of headache ...
Wellington da Mata
2 months after
Thank you, I'm two days trying to resolve this error.

Wellington - Sao Paulo - Brazil
Anders Wilson
3 months after
Fantastic, it did it - no idea why! Thanks a bunch.
martin
5 months after
You could also have solved that by just using mysql instead of mysqlnd
zerocool
5 months after
thanks.....
Kalle
7 months after
GREAT! WORKS
Shrikant
7 months after
thanks a lot man !!

Add comment











A la recherche de projets symfony ?

Tags

Last posts