GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 11-Dec-2004, 13:37
RyanM RyanM is offline
New Member
 
Join Date: Nov 2004
Posts: 2
RyanM is on a distinguished road

MySQL 4.1 and PHP 4.x


I'm sorry if this has already been asked. Did a few searches, but the term limit of 4 characters made searching for "4.1" a little difficult.

Using PHP 4.3.9 and MySQL 4.1, I have the following code: (obviously, some of the details like the password and username were changed)
PHP Code:

// This is actually in a separate file which I include.
    $database_host =        '127.0.0.1';
    $database_user =        'thesite';
    $database_password =    'password';
    $database_data =        'teamsite'; // Name of database we should use

// And the code which gives me a problem:
    $connection = mysql_connect($database_host, $database_user, $database_password); 



I get
Quote:
Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client...

I know that I could solve the problem by upgrading to php5, but the hosting service I will be using after development may not upgrade for a while. Is there a way to get this to work?
  #2  
Old 11-Dec-2004, 18:53
JasonMichael's Avatar
JasonMichael JasonMichael is offline
Awaiting Email Confirmation
 
Join Date: Jul 2004
Posts: 135
JasonMichael has a spectacular aura about
Try changing your database host '127.0.0.1' to say 'localhost', instead.

I can't see how changing your PHP or MySQL version will make a difference - its just supposed to work from PHP. Are you running this from a Windows system?
  #3  
Old 11-Dec-2004, 22:03
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Hello RyanM,

I have not updated my MySQL server to the latest version (4.1) yet so I am unable to help you with this particular problem.

However, a quick search on the MySQL website yielded an interesting page full of information I think you can use to fix your problem, at least you can understand why it's happening.

Quote:
A.2.3 Client does not support authentication protocol

MySQL 4.1 and up uses an authentication protocol based on a password hashing algorithm that is incompatible with that used by older clients. If you upgrade the server to 4.1, attempts to connect to it with an older client may fail with the following message:

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

To solve this problem, you should use one of the following approaches:

* Upgrade all client programs to use a 4.1.1 or newer client library.
* When connecting to the server with a pre-4.1 client program, use an account that still has a pre-4.1-style password.
* Reset the password to pre-4.1 style for each user that needs to use a pre-4.1 client program. This can be done using the SET PASSWORD statement and the OLD_PASSWORD() function:... more >>
  #4  
Old 12-Dec-2004, 06:02
RyanM RyanM is offline
New Member
 
Join Date: Nov 2004
Posts: 2
RyanM is on a distinguished road
Quote:
Originally Posted by JdS
Hello RyanM,

I have not updated my MySQL server to the latest version (4.1) yet so I am unable to help you with this particular problem.

However, a quick search on the MySQL website yielded an interesting page full of information I think you can use to fix your problem, at least you can understand why it's happening.
Thanks JdS!

I got it to work by setting up the old password as stated in the directions.
  #5  
Old 13-Dec-2004, 08:14
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
No, I must thank you instead for asking this question.

At least I will have one less issue to figure out when I upgrade MySQL on my own machine soon.
  #6  
Old 22-Jan-2005, 17:09
cooljock cooljock is offline
New Member
 
Join Date: Jan 2005
Posts: 6
cooljock is an unknown quantity at this point
Quote:
Originally Posted by JdS
No, I must thank you instead for asking this question.

At least I will have one less issue to figure out when I upgrade MySQL on my own machine soon.
LOL NERDS!!!!!!!!!
 
 

Recent GIDBlog2nd Week of IA Training by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
RESELLER WEB HOSTING - $9.99/MONTH For 4GB HD & 30GB BW! CPanel, PHP, MySQL & MORE! IncognitoNet Web Hosting Advertisements & Offers 0 11-Nov-2004 19:51
PHP, MySQL, WML skyloon MySQL / PHP Forum 0 05-Mar-2004 07:53
FREE 25 MB, No Ads, Control Panel, ASP, ColdFusion, PHP, MySQL, Access Hosting rkmails Free Web Hosting 0 08-Sep-2003 05:49
[script] Password Protect web pages/site using PHP and MySQL JdS PHP Code Library 0 23-Jul-2003 10:02
Windows: From only £20p/y,Linux: from $10p/m. ASP, ASP.NET, PHP, Free MySQL, +More EyotaHosts Web Hosting Advertisements & Offers 0 28-Jun-2003 13:54

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 00:30.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.