Warning:mysql_connect() [function.mysql-connect]: [2002] 由于目标机器.
发布:smiling 来源: PHP粉丝网 添加日期:2014-09-25 15:35:43 浏览: 评论:0
今天在测试一数据处理功能发现连接mysql时突然碰到Warning: mysql_connect() [function.mysql-connect]:[2002] 由于目标机器积极拒绝,无法连接提示了,下面我们一起来看问题解决方法.
错误代码如下:
- aabb Warning: mysql_connect() [function.mysql-connect]: [2002] 由于目标机器积极拒绝,无法连接.(trying to connect via tcp://localhost:3306) in X:test7.php on line 6
- Warning: mysql_connect() [function.mysql-connect]: 由于目标机器积极拒绝,无法连接。 in X:test7.php on line 6
- Warning: mysql_select_db() [function.mysql-select-db]: [2002] 由于目标机器积极拒绝,无法连接。 (trying to connect via tcp://localhost:3306) in X:test7.php on line 7
- Warning: mysql_select_db() [function.mysql-select-db]: 由于目标机器积极拒绝,无法连接。 in X:test7.php on line 7
- Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in X:test7.php on line 7
- Warning: mysql_query() [function.mysql-query]: [2002] 由于目标机器积极拒绝,无法连接。 (trying to connect via tcp://localhost:3306) in X:test7.php on line 8
- Warning: mysql_query() [function.mysql-query]: 由于目标机器积极拒绝,无法连接。 in X:test7.php on line 8
- Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in X:test7.php on line 8
- Warning: mysql_query() [function.mysql-query]: [2002] 由于目标机器积极拒绝,无法连接。 (trying to connect via tcp://localhost:3306) in X:test7.php on line 14
- Warning: mysql_query() [function.mysql-query]: 由于目标机器积极拒绝,无法连接。 in X:test7.php on line 14
- Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in X:test7.php on line 14
- Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in X:test7.php on line 15
- Array ( )
程序代码很简单,代码如下:
- $sql = "Select * from v_xyp where systype=5 ";
- $array = array();
- $rq = mysql_query( $sql );
- if( mysql_num_rows( $rq ) )
- {
- while( $rs = mysql_fetch_array( $rq ) )
- {
- //$sql ="update v_xyp set b_body= '".str_replace("'",'',strip_tags(stripslashes($rs['U_love'])))."' where id=".$rs['id'];
- //mysql_query( $sql ) ;//or die(mysql_error());
- //echo $rs['id'].'<br />';
- $sqlb ="select * from v_xyp where systype=5 and b_body='".str_replace("'",'',strip_tags(stripslashes($rs['U_love'])))."' and id<>".$rs['id'];
- $query = mysql_query( $sqlb ) ;//or die(mysql_error());
- $num = mysql_num_rows( $query );
- if( $num )//开源代码phpfensi.com
- {
- echo '<font color="#0000FF">{'.$rs['title'].'}重复内容有{'.$num.'}条</font><br />';
- while( $rs1 = mysql_fetch_array( $query ) )
- {
- echo $rs1['title'].'<br />';
- }
- echo '<hr />';
- }/**/
- }
- //echo '标题:<font color=red>'.$title.'</font>己处理过,自动跳过!';
- }
解决办法:想来想去都没想到,后来在服务中看mysql状态结果自动挂了,mysql自动停了,这个可能与我数据处理量或算法有问题了,重启mysql就解决了.
Tags: mysql_connect() function mysql-connect
- 上一篇:Mysql中IFNULL与IN操作
- 下一篇:mysql一对多关联查询的时候筛选条件
相关文章
- ·mysql中FUNCTION xxx.LEN does not exist错误(2014-10-12)
推荐文章
热门文章
最新评论文章
- 写给考虑创业的年轻程序员(10)
- PHP新手上路(一)(7)
- 惹恼程序员的十件事(5)
- PHP邮件发送例子,已测试成功(5)
- 致初学者:PHP比ASP优秀的七个理由(4)
- PHP会被淘汰吗?(4)
- PHP新手上路(四)(4)
- 如何去学习PHP?(2)
- 简单入门级php分页代码(2)
- php中邮箱email 电话等格式的验证(2)