Tip: Mysql Client problem: Client does not support authentication
Posted by: Floresense Team
If you get an error like
Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in xxx (file) on line 52. Unable to connect to SQL server Probably your programming environment like PHP is using an older MySQL client version to query MySQL.
With MySQL version 4.1, the MySQL team changed the password hash algorithm or something internal because of which this is happening.
So new mysql versions clients are not directly backward compatible. Fortunately, there's an easy remedy out of this. Its a two step process.
1st Change: Execute the below sql statements in your mysql environment.
mysql> SET PASSWORD FOR -> 'some_user'@'some_host' = -> OLD_PASSWORD('newpwd');
mysql> UPDATE mysql.user SET Password = -> OLD_PASSWORD('newpwd') -> WHERE Host = 'some_host' AND -> User = 'some_user'; mysql> FLUSH PRIVILEGES;
2nd Change: A small change makes the MySQL 4.1 server compatible with 3.x clients(that comes with php5 or earlier).... by adding a line/option pointing that passwords sent to the engine are of old password format. This change you have to make in the the MySQL server's "my.cnf" / "my.ini" file in your mysql installation.
Add the below line under the [mysqld] options.. in the file.
[mysqld]
old_passwords=1
...
Referrence: http://dev.mysql.com/doc/refman/5.0/en/old-client.html
Troubleshooting: If it still doesn't work, try the following.
On machines other than windows, the above should have fixed the problem, restarting might help if it hasn't.
On windows machines, Put your my.ini file in the c:\windows\ (or windows root) directory and try. If you don't have a my.ini in your windows root directory, copy the my.ini from mysql installation folder.
Advertisement
|