| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3225 人关注过本帖
标题:[求助]为何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
快速回复:[求助]为何mysql_connect无法解析
数据加载中...
 
   



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

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