Php5 And Mysql...
antifreeze
The guy with the goods! Join Date: 2003-05-12 Member: 16232Members, Constellation
<div class="IPBDescription">Makes my head sting....</div> For the last few days i have been trying to set up an apache PHP5 MySql server. The apache bit is fine and so is the PHP bit, it's just the damned my SQL bit. I got all the DLL's installed (before when i did it wrong the apache server wouldn't start but now it does so i guess it's right).
Apache = 2.0
PHP = 5
MySQL = 4.1.7
I downloaded some code from the net to test that it's working and it all i get is this messege.
<!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->
Warning: mysql_connect() [function.mysql-connect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client in Z:\wwwroot\TestScripts\test.php on line 19
Could not connect: Client does not support authentication protocol requested by server; consider upgrading MySQL client
<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
I have no idea why it's doing this but when i open the MySQL admin thing the aborted connects rises everytime i run the script.
Any idea why it's happening and how to fix it?
EDIT:
<!--QuoteBegin-The Test Script+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (The Test Script)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->
<HTML>
<HEAD></HEAD>
<BODY>
<?php
define("SQL_HOST", "localhost"); // Name or IP of MySQL server
define("SQL_USER", "root"); // MySQL user name
define("SQL_PWD", "SNIP"); // MySQL password
define("SQL_DB", "phphits"); // Name of database
define("SQL_TABLE", "log"); // Name of table
define("SQL_SHOW_ERRORS", "1"); // Should the script produce MySQL error messages or not
/////////////// Connect to MySQL server ///////////////
//$sql_id = @mysql_connect(SQL_HOST, SQL_USER, SQL_PWD)
$link = mysql_connect(SQL_HOST, SQL_USER, SQL_PWD)
or die('Could not connect: ' . mysql_error());
echo 'Connected successfully';
?>
</BODY>
</HTML>
<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
Apache = 2.0
PHP = 5
MySQL = 4.1.7
I downloaded some code from the net to test that it's working and it all i get is this messege.
<!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->
Warning: mysql_connect() [function.mysql-connect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client in Z:\wwwroot\TestScripts\test.php on line 19
Could not connect: Client does not support authentication protocol requested by server; consider upgrading MySQL client
<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
I have no idea why it's doing this but when i open the MySQL admin thing the aborted connects rises everytime i run the script.
Any idea why it's happening and how to fix it?
EDIT:
<!--QuoteBegin-The Test Script+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (The Test Script)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->
<HTML>
<HEAD></HEAD>
<BODY>
<?php
define("SQL_HOST", "localhost"); // Name or IP of MySQL server
define("SQL_USER", "root"); // MySQL user name
define("SQL_PWD", "SNIP"); // MySQL password
define("SQL_DB", "phphits"); // Name of database
define("SQL_TABLE", "log"); // Name of table
define("SQL_SHOW_ERRORS", "1"); // Should the script produce MySQL error messages or not
/////////////// Connect to MySQL server ///////////////
//$sql_id = @mysql_connect(SQL_HOST, SQL_USER, SQL_PWD)
$link = mysql_connect(SQL_HOST, SQL_USER, SQL_PWD)
or die('Could not connect: ' . mysql_error());
echo 'Connected successfully';
?>
</BODY>
</HTML>
<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
Comments
<a href='http://www.apachefriends.org/en/' target='_blank'>Apachefriends</a> is an organisation which provides a package that runs both, easy as pai.
The thing you need is <a href='http://www.apachefriends.org/en/xampp.html' target='_blank'>XAMPP</a> (available for linux and windows).
There are also plugins so you can enable Perl support and many other things.
Have fun.
antifreeze: I haven't messed w/ apache, mysql, and php on windows, but it sounds like you have your mysql server set up to not allow remote connections. Or is this all on one box?
Can you log into the mysql server w/ that username and password directly (as in, on that same box)?