主题:求助:php连接MySQL的问题
运行环境如下:
Apache 2.0.55
PHP 4.4.2
MySQL 5.0
命令提示符下进入MySQL可以进行数据库操作
在浏览器中输入Http://localhost可以访问常规PHP页面.
mysql服务已开启,并有mysql.exe,mysqld-nt.exe进程.
进行测试时输入以下语句:
<?php
$db=mysql_connect("localhost","root","123");
if ($db)
{
echo "connect sql success.";
}
else echo "connect sql fail.";
?>
出现有以下警告:
Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in F:\My Documents\Web\test.php on line 10
如果在mysql_connect()前加'@'也会显示:"connect sql fail";
请教大家这是什么原因?
Apache 2.0.55
PHP 4.4.2
MySQL 5.0
命令提示符下进入MySQL可以进行数据库操作
在浏览器中输入Http://localhost可以访问常规PHP页面.
mysql服务已开启,并有mysql.exe,mysqld-nt.exe进程.
进行测试时输入以下语句:
<?php
$db=mysql_connect("localhost","root","123");
if ($db)
{
echo "connect sql success.";
}
else echo "connect sql fail.";
?>
出现有以下警告:
Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in F:\My Documents\Web\test.php on line 10
如果在mysql_connect()前加'@'也会显示:"connect sql fail";
请教大家这是什么原因?