现在Apache和MySQL都可以正常运行了,但是我写了一个很简单的测试代码,却报错,信息如下: Warning: mysql_connect() [function.mysql-connect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client in c:\Tools\apache group\Apache\htdocs\DB_Test.php on line 8Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'ODBC'@'localhost' (using password: NO) in c:\Tools\apache group\Apache\htdocs\DB_Test.php on line 9Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in c:\Tools\apache group\Apache\htdocs\DB_Test.php on line 9我写的代码如下: <html> <head> <title>连接数据库</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> </head> <body bgcolor="#FFFFFF"> <?php $conn=mysql_connect("localhost","root","password"); if(mysql_select_db("mysql")) { //testconnection //testconnection echo "链接成功!!"; } else { echo "无法打开数据库db,请确认用户名和密码!!"; } ?> </body> </html>麻烦高手帮忙看看,谢谢!!
apache -k install 可以安装服务
更多的设置请下载apache用户手册不建议apache和iis共存
当有asp或.net应用时可设置iis支持php
否则仅用apache
当一定要apache和iis共存时,宜用apache做主web服务器,通过apache的代理转向功能使用iis
把APACHE服务重启一下你的PHP没有编译进APACHE,需要把PHP编译进APACHE。
建议不要在这方面下很大的功夫。你去
http://www.appservnetwork.com/
下载一个傻瓜版的看你的需要下载,有两种版本,一个PHP5+APACHE2的,一个是PHP4+APAHCE1.3的,支持MySQL,如果安装了PG,不用设置就支持PG了。另:最好停了IIS,又学ASP又学PHP你有这么多精力么?老子教导我们:要精通一门不要样样都通样样都不精。
Warning: mysql_connect() [function.mysql-connect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client in c:\Tools\apache group\Apache\htdocs\DB_Test.php on line 8Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'ODBC'@'localhost' (using password: NO) in c:\Tools\apache group\Apache\htdocs\DB_Test.php on line 9Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in c:\Tools\apache group\Apache\htdocs\DB_Test.php on line 9我写的代码如下:
<html>
<head>
<title>连接数据库</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
</head>
<body bgcolor="#FFFFFF">
<?php
$conn=mysql_connect("localhost","root","password");
if(mysql_select_db("mysql"))
{
//testconnection
//testconnection
echo "链接成功!!";
} else
{
echo "无法打开数据库db,请确认用户名和密码!!";
}
?>
</body>
</html>麻烦高手帮忙看看,谢谢!!