标题:[求助]为何mysql_connect无法解析
只看楼主
yizhongyz983
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2006-3-4
得分:0 

还是有问题,而且好像问题更多了

Warning: mysql_connect() [function.mysql-connect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client in d:\AppServ\www\count.php on line 12

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in d:\AppServ\www\count.php on line 18

Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in d:\AppServ\www\count.php on line 21

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in d:\AppServ\www\count.php on line 21

Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in d:\AppServ\www\count.php on line 24

源程序为

<?

//------[基本设定]-------
$mysql_server_name = "localhost";
$mysql_username = "**********";
$mysql_password = "*******";
$mysql_database = "******";
//-------


//建立连线---通过(服务器名称、用户姓名、用户密码)
$conn = mysql_connect($mysql_server_name, $mysql_username, $mysql_password);

//准备好你的sql语法
$sql = "INSERT INTO `count` ( `new` ) VALUES ('1')";

//准备你要处理的资料库
mysql_select_db($mysql_database,$conn);

//进行查询
$result = mysql_query($sql);

//结束并释放链路
mysql_close($conn);

?>


2006-03-04 21:59
yizhongyz983
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2006-3-4
得分:0 

出现了这样一个问题,当我要测试计数器的时候,ie出现提示:
Fatal error: Call to undefined function mysql_connect() in d:\AppServ\www\test.php on line 7
test.php的内容是这样的:
<?
$mysql_server_name = "localhost";
$mysql_username = "****";
$mysql_password = "****";
$mysql_database = "****";

$conn = mysql_connect( $mysql_server_name,$mysql_username,$mysql_password );
$sql ="INSERT INTO `count` ( `new` ) VALUES ('1')";
mysql_select_db($mysql_database,$conn);
$result = mysql_query($sql);
mysql_close($conn);
?>

我查了一下,修改了一下windows里面的php.ini文件,
查找 extension=php_mysql.dll 字串.删除掉前面的 ; 号
extension=php_mysql.dll
结果出现这样的问题:
Warning: mysql_connect() [function.mysql-connect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client in d:\AppServ\www\test.php on line 7

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in d:\AppServ\www\test.php on line 9

Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in d:\AppServ\www\test.php on line 10

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in d:\AppServ\www\test.php on line 10

Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in d:\AppServ\www\test.php on line 11

我想知道是哪里出问题了。谢谢。

2006-03-12 20:43



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-47243-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.598396 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved