LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Warning: mysql_connect(): Client does not support authentication protocol (https://www.linuxquestions.org/questions/linux-general-1/warning-mysql_connect-client-does-not-support-authentication-protocol-311244/)

I_AM 04-08-2005 06:44 PM

Warning: mysql_connect(): Client does not support authentication protocol
 
Hello there. I am trying to connect to a sql database. I made a small test script to test the connection. I am using the sample code that was given from cpanel.

I keep getting the following warning:

Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in /home/canoesfo/public_html/test.php on line 10 I cannot connect to the database because: Client does not support authentication protocol requested by server; consider upgrading MySQL client

What should I do? Where do I tweak the security settings for this type of thing?

I saw only a few other threads somewhat similiar and the methods didn't work for me.

/scripts/makecpphp
/scripts/easyapache
/scripts/updatenow
/scripts/mysqlup --force

I have MySQL 4.1.10a-standard

zeos 04-08-2005 07:12 PM

Welcome to the hell that is php/mysql ....your version of php doesn't have support for mysql 4.1.x's new password hashing algorithm. If you can connect directly to your mysql database, execute the following:

mysql> use mysql;

mysql> SET PASSWORD FOR 'username'@'hostname' = OLD_PASSWORD('password');

mysql> FLUSH PRIVILEGES;


where username is your mysql user that you're trying to connect as, hostname is the host (probably localhost in your case) and the last 'password' is the password you wish your user to use.

This will revert the password back to the older algorithm and should allow php to connect again. To force new accounts to be made with the old style passwords, you can edit /etc/my.cnf and add "old-passwords" as an option under the [mysqld] section and restart mysql...

ucatalg 09-28-2006 05:31 AM

Mysql connect
 
Thanks a lot for the welcome to hell.
I works just like you said, but it did work without the 'flush privileges' command.
May I know whats the purpose for this? Actually I used this on setting up my phpMyadmin, I'm so glad I read this thread.


Many Thanks,

Arthur, CCNA

trickykid 09-28-2006 04:03 PM

Different versions of MySQL require different ways of setting up passwords and privileges. In some cases, you will get this error when the remote machine your trying to connect from is using an older version of MySQL client, etc.

srelliott 06-19-2009 11:30 AM

Great Solution -- Worked for Windows MySQL
 
Thank you for the post. It worked with a minor tweek.

use mysql;
SET PASSWORD FOR 'username' = OLD_PASSWORD('password');

Didn't have to flush, but I did have to remove the @'localhost' as the version I'm using in Windows didn't require that.

Thanks for the tip. Normally I use Apace and Linux, but was stumped on this windows box at work until I found this thread.

Thanks again,

Shannon


All times are GMT -5. The time now is 11:56 PM.