PDA

View Full Version : Problem: "Client does not support authentication protocol requested by server"


Gary Williams
10-25-2009, 12:23 PM
Hi All,

I have recently transfered a MySQL database from one server to another. When I try to connect to my MySQL database (with my normal asp connection string), I get the following error message:

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

It looks like my original servers version of MySQL is older than the current one. Looking around the net, I have found the following explanation:

"This happens because the latest versions of MySql uses a new format for the password (it's a longer hash). In order for old clients to continue to use the newer server, you have to set the passwords on the server to their old format or upgrade your client. Because upgrading the client can sometimes be a pain, it's often easier to just update the passwords to the old format on the server."

As my new server is a virtual one, I cannot use the following three solutions. How can I modify my existing database to solve this problem?

Regards

Gary

======================

Solution #1:

Run mysql and login as root:

[ICODE] mysql -u root -p [ICODE]

Then, paste the following command, editing as necessary, to change the password of the user to the old format.

[CODE]
UPDATE mysql.user
SET password=OLD_PASSWORD('somepassword')
WHERE user='someuser'
AND host='somehost';
[CODE]

After you have set the passwords to the old format, flush the tables.

flush privileges;

Then exit the mysql client with "quit" and you are set.

======================

Solution #2:

Change the password algorithm to the old one.

to do so, open the SQL command line.
type your password.

the prompt says MYSQL>

then type in this

[CODE]
MYSQL> set password for
-> some_user@localhost = OLD_PASSWORD('some_password');
[CODE]

replace some_user and some_password with the username and the password you want.

======================

Solution #3

If you are using PHPMyAdmin, just go the the "Privileges" tab.
Edit the user containing username and host you want to use with. In the "Change Password" box below, you can choose whether using password or no. The solution is in there: Choose "MySQL 4.0 Compatible" and "Go".

=====================

Old Pedant
10-25-2009, 09:24 PM
??? Why can't you use solution #3???

Virtual or not, it must allow a connection, no?

If you mean that you can't even *connect* to the DB, because of the password problem, then you'll have to get somebody with ROOT (or at least ADMIN) privileges to do one of those for you.

Actually, if the only password you are concerned about is the one used by your ASP code to make the connection, just ask somebody with ROOT/ADMIN privileges to set the password to a new value of your choosing. If they do it and it uses the new hash, then of course your connection string will now work.

Gary Williams
10-25-2009, 10:59 PM
Hi OP,

>>>> ??? Why can't you use solution #3???

I think I can but I'll have to get the support people to enable the 'Privileges' tab for me tomorrow (Monday)


>>>>> Actually, if the only password you are concerned about is the one used by your ASP code to make the connection, just ask somebody with ROOT/ADMIN privileges to set the password to a new value of your choosing. If they do it and it uses the new hash, then of course your connection string will now work.

YES! Genius. I completely missed that one.

Thanks OP, I'll email support now.

Regards

Gary

Gary Williams
10-27-2009, 10:11 AM
Hi OP,

Yes, having the support staff change the password at their end fixed the problem.

Many thanks!

Gary