domingo, 8 de junio de 2014

MySQL - Authentication with old password no longer supported

I was resuming a web development for a customer and when I tried to test it live on the internet ¡bang!, an error jumps out when the application attempts to connect to the database: "Authentication with old password no longer supported, use 4.1 style passwords".

 SET PASSWORD FOR 'username'@'%' = password( 'mynewpassword' )

I made some attempts to change the password but I kept getting some other errors:

Access denied for user 'username'@'localhost' to database 'mysql' 
Access denied for user 'username'@'%' to database 'mysql' 

Finally, I double checked the official MySQL pages (here) and found the solución. It turned out that I only needed to write the database user name without the quotes:

 SET PASSWORD FOR username = password( 'mynewpassword' )

Summary: it seems that there was a change in MySQL version 5.1 regarding how the password is encrypted. Then I suspected that my web hosting was using a non fully compatible Parallels Plesk Panel/cPanel - PHP MyAdmin - MySQL.

I solved the issue but if you, like me, are curious about the MySQL server version your web hosting is using, you can get that data by executing the following query:



No hay comentarios.: