Jul 16 2007

how to use old password with MySQL 5

Tag:tepezcuintle @ 20:37

Sometimes when you are connecting from php4 to a mysql 5 server you might get an error like.

Client does not support authentication protocol requested by server; consider upgrading MySQL client

so basically before you go crazy and rip your hair out, what is happening is that you are trying to connect
with an outdated protocol to a mysql server that doesn’t understand your password even though it is the correct one.

What you need to do is the following
login to the mysql server as root

mysql -u root -p

enter your password and you will be at the mysql prompt

mysql>

paste this ( make sure you change the username and host fields to the user you want to change and the hostname )

UPDATE mysql.user
SET password=OLD_PASSWORD(’password’)
WHERE user=’usename’
AND host=’hostname’;

then after that

type

flush privileges;

then after doing that try to reconnect from your PHP application that you were having problems with.

You should be able to connect now.

Bsically you told mysql to use the old password format for whatever user you selected.