LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-08-2005, 06:44 PM   #1
I_AM
Member
 
Registered: Mar 2005
Posts: 103

Rep: Reputation: 15
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
 
Old 04-08-2005, 07:12 PM   #2
zeos
Member
 
Registered: Aug 2003
Posts: 150

Rep: Reputation: 15
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...

Last edited by zeos; 04-08-2005 at 07:19 PM.
 
Old 09-28-2006, 05:31 AM   #3
ucatalg
LQ Newbie
 
Registered: Sep 2006
Posts: 1

Rep: Reputation: 0
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
 
Old 09-28-2006, 04:03 PM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 253Reputation: 253Reputation: 253
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.
 
Old 06-19-2009, 11:30 AM   #5
srelliott
LQ Newbie
 
Registered: Jun 2009
Posts: 2

Rep: Reputation: 0
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR 1251: Client does not support authentication protocol javier_ccs Programming 1 06-15-2005 10:12 AM
sendmail Authentication-Warning and spam chaitrahb Linux - General 1 02-03-2005 03:01 PM
X-Authentication-Warning noir911 *BSD 0 08-10-2004 01:03 PM
Wierd error with ping WARNING: failed to install socket filter: Protocol not availabl abefroman Linux - Networking 4 03-25-2004 05:48 PM
Warning: failed to install socket filter: Protocol not available ixion Linux - Networking 0 08-12-2003 09:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration