Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mysql_connect doesn't work

Status
Not open for further replies.

alfalf

Programmer
Mar 6, 2003
155
BA
Hello all.

I recently installed Mysql 4.1 Server, on a mashine with WinXP having APacheSSL server.

Apache/SSL is working fine.
Mysql as service is started/working OK.
Mysql is using server instance configuration.
PHP is also working OK except connectiong to mysql server.

One of procedures that connects to db is:
Code:
    // Set database connection variables
    $dbhost = 'localhost';
    $dbpass = 'my_pwd';
    $dbuser = 'root';
    $dbname = 'books_db';

    // Connect to mysql and select the db
    mysql_connect($dbhost, $dbuser, $dbpass);
    mysql_select_db($dbname);

    // Query the database
    $result = mysql_query("SELECT id, title, author FROM books WHERE id = '$id'");

so there's no syntax error in it. Also, as note, this code works on other mysql/apache/php configured mashine.

So, when executed, this is first message that I receive:

Warning: mysql_connect() [function.mysql-connect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client in...

So, if anyone have any suggestion? Perhaps some configuration of PHP or something?

Other details:
PHP 4.3.0
Server API Apache 1.3.27/OpenSSL 0.9.6g/mod_ssl 2.8.12
OS Win XP
PC: AMD Athlon 64 / 512MB RAM

Thanks for any suggestions.
 
Try getting PHP 4.3.8 because its the most stable update release. Or consider PHP5. See if this makes a difference.

I use MySQL v4, this works fine for me.

Regards,

Martin

Gaming Help And Info:
 
Your problem is that the communications protocol to MySQL changed a MySQL version 4.1.3. PHP supports the newer protocol, but only through the Improved MySQL functions.

You'll need to activate the mysqli_* family of functions on your machine and use those instead. This may require an upgrade of your PHP version -- I don't remember when the mysqli_* functions were added to PHP.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top