Posted by Klaus Hansen on 06/03/05 15:35
Hi all
Using Windows XP, PHP4.3.11 and Mysql 4.1.
Im a newbie to PHP and Mysql.
Im trying to connect to the database with this script:
<?php
//list_db.php
$link_id = mysql_connect("localhost", "phpuser", "phppass");
$result = mysql_list_dbs($link_id);
$num_rows = mysql_num_rows($result);
while($db_data = mysql_fetch_row($result)) {
echo $db_data[0]. "<BR>";
$result2 = mysql_list_tables($db_data[0]);
$num_rows2 = mysql_num_rows($result2);
while($table_data = mysql_fetch_row($result2)) echo "--" .
$table_data[0]. "<BR>";
echo "==> $num_rows2 table(s) in " . $db_data[0] . "<P>";
}
?>
But it gives me this error:Warning: mysql_connect(): Client does not support
authentication protocol requested by server; consider upgrading MySQL client
in c:\inetpub\wwwroot\PHP4info.php on line 5Warning: mysql_list_dbs():
supplied argument is not a valid MySQL-Link resource in
c:\inetpub\wwwroot\PHP4info.php on line 6Warning: mysql_num_rows(): supplied
argument is not a valid MySQL result resource in
c:\inetpub\wwwroot\PHP4info.php on line 7Warning: mysql_fetch_row():
supplied argument is not a valid MySQL result resource in
c:\inetpub\wwwroot\PHP4info.php on line 9What did I do wrong ?The database
is running well.Best regardsKlaus Hansen
Navigation:
[Reply to this message]
|