Jump to content

Database Connection Error


pkmleo

Recommended Posts

Hi,

I am relatively new to PHP. I installed PHP 4.2.3 with Apache 1.3 and MySQL 5 on Windows XP Pro. When I try to run a simple program that connects to the database and fetch records I get this errors:

Warning: Client does not support authentication protocol requested by server; consider upgrading MySQL client in d:\apache group\apache\htdocs\test\first.php on line 4

Warning: MySQL Connection Failed: Client does not support authentication protocol requested by server; consider upgrading MySQL client in d:\apache group\apache\htdocs\test\first.php on line 4

I dont understand what this means. Should I upgrade PHP. In that case the web hosting company does not support PHP 5. Is there any way to solve this problem. I am using MySQL for Java programs and it works fine.

Cheers,
pkmleo
Link to comment
Share on other sites

Thanks for the reply. The code I am using is:

<?php
$db = mysql_connect("localhost","root","root");
mysql_select_db("sitename",$db);
$result = mysql_query("SELECT * FROM creative",$db);
printf("Cat ID: %s<br>\n", mysql_result($result,0,"cat_id"));
printf("Cat Name: %s<br>\n", mysql_result($result,0,"cat_name"));
printf("Job Ref: %s<br>\n", mysql_result($result,0,"job_ref"));
?>

I checked the database its working and I can log into it and I am able to connect to this database using Java. The port is default which is 3306.
Link to comment
Share on other sites

[!--quoteo(post=357080:date=Mar 21 2006, 08:36 PM:name=pkmleo)--][div class=\'quotetop\']QUOTE(pkmleo @ Mar 21 2006, 08:36 PM) [snapback]357080[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Thanks for the reply. The code I am using is:

<?php
$db = mysql_connect("localhost","root","root");
mysql_select_db("sitename",$db);
$result = mysql_query("SELECT * FROM creative",$db);
printf("Cat ID: %s<br>\n", mysql_result($result,0,"cat_id"));
printf("Cat Name: %s<br>\n", mysql_result($result,0,"cat_name"));
printf("Job Ref: %s<br>\n", mysql_result($result,0,"job_ref"));
?>

I checked the database its working and I can log into it and I am able to connect to this database using Java. The port is default which is 3306.
[/quote]

Your code is fine, but it seems you have a setting in MySQL, specifically your 'authentication protocol...' I have never sen this error before, so I can't be of much assistance other than to say your code looks fine. I think that you should do some googling, or potentially wait for someone else more knowledgeable to come along.

Good luck
Link to comment
Share on other sites

Go here for solution

[a href=\"http://dev.mysql.com/doc/refman/5.0/en/old-client.html\" target=\"_blank\"]http://dev.mysql.com/doc/refman/5.0/en/old-client.html[/a]

You will have to give yourself a new password but it will fix the problem

Ray
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.