pkmleo Posted March 21, 2006 Share Posted March 21, 2006 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 4Warning: 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 4I 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 https://forums.phpfreaks.com/topic/5418-database-connection-error/ Share on other sites More sharing options...
blazing_bruce Posted March 21, 2006 Share Posted March 21, 2006 will you please show that db connectivity codes? like mysql_connect and are you sure that the port(which is used by mysql )is opened. show your code here plz.Thank youKarthi keyan Link to comment https://forums.phpfreaks.com/topic/5418-database-connection-error/#findComment-19331 Share on other sites More sharing options...
pkmleo Posted March 21, 2006 Author Share Posted March 21, 2006 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 https://forums.phpfreaks.com/topic/5418-database-connection-error/#findComment-19449 Share on other sites More sharing options...
keeB Posted March 21, 2006 Share Posted March 21, 2006 [!--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 https://forums.phpfreaks.com/topic/5418-database-connection-error/#findComment-19453 Share on other sites More sharing options...
craygo Posted March 21, 2006 Share Posted March 21, 2006 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 problemRay Link to comment https://forums.phpfreaks.com/topic/5418-database-connection-error/#findComment-19455 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.