mysql_connect function error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jeva39
Forum Commoner
Posts: 45
Joined: Sun Aug 27, 2006 11:45 pm
Location: Panamá

mysql_connect function error

Post by jeva39 »

I have this lines:

Code: Select all

14 $con = mysql_connect("localhost", "root", "xxxxx")or die('MySQL Connect Error: '.mysql_error());
15 mysql_select_db("midis"); 
16 $sql = "select tema,ritmo from temas order by tema";
But I receive this error:
mysql_connect() [function.mysql-connect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client in C:\Inetpub\wwwroot\PHP\Function_DB_mySQL.php on line 14

Please, what is the cause of this error?

Thanks...
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

You need to be running the same version of MySQL locally, as what's running on the server. Your MySQL client (which PHP is using) is trying to send passwords in the wrong format for the version of MySQL on the server.
User avatar
dibyendrah
Forum Contributor
Posts: 491
Joined: Wed Oct 19, 2005 5:14 am
Location: Nepal
Contact:

Post by dibyendrah »

Which version of MySQL client are you using ?

This might happen if your mysql client is old and can be solved by upgrading the mysql client.
jeva39
Forum Commoner
Posts: 45
Joined: Sun Aug 27, 2006 11:45 pm
Location: Panamá

Post by jeva39 »

I'm using mySql version 5.0.24 and PHP 4.4.1.

I don't test the APP in my Hosting Server. I test my APP locally in my machine using ENGINSITE Editor or NuSphere 4.5.

Thanks
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Search your system for libmysql.dll
Where are these files located?
jeva39
Forum Commoner
Posts: 45
Joined: Sun Aug 27, 2006 11:45 pm
Location: Panamá

Post by jeva39 »

Ooops... Don't exists!!! What I can happen? Please, what is the correct location for this .DLL?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Then the mysql client library was compiled into php.
Take a look at http://dev.mysql.com/doc/refman/5.0/en/old-client.html
jeva39
Forum Commoner
Posts: 45
Joined: Sun Aug 27, 2006 11:45 pm
Location: Panamá

Post by jeva39 »

Sorry by my error: the LIBMYSQL.DLL really exists in C:\MySql\Bin directory.
jeva39
Forum Commoner
Posts: 45
Joined: Sun Aug 27, 2006 11:45 pm
Location: Panamá

Post by jeva39 »

Problem solved!!! Thanks very much to all...
Post Reply