网站需要增加MYSQL连接数,详见文章:http://www.fanqiang.com/a2/b1/20010705/140800801.html
加大mysql的最大连接数

解决方案 »

  1.   

    请用mysql_pconnect()
    另外不要频繁close()
    还有就是尽量加大内存如果问题没有解决,请加上启动参数
    vi /etc/rc.d/rc.local
    safe_mysqld -O max_connections=500 &
    就行了
    总之很多方法的!!自己搜索一下这里
      

  2.   

    可能是你的MySQL服务器主机的最大连接数有限制;
    也许是别人连接的同一个MySQL服务器的人数过多,
    我在用freesql.org上的MySQL服务器连接时就有时会出现问题。
    你的网址是?
      

  3.   

    <?
     $link=mysql_pconnect("localhost","root","");
     mysql_select_db("MFTDB",$link);
     $str="select password from users where user='ANDY'";
     $result=mysql_query($str,$link);
     if (mysql_num_rows($result)>0):
       list($password)=mysql_fetch_row($result);
       echo "password:".$password;
     endif;
    ?>
    上面的代码是在php+mysql+apache+linux下的,我就在相同IP的机上,用5个(或更多的)IE打开上面的页面,mysql中就会有5条连接(或更多),也就是开一次会多一条,我不知是怎么回事,最后也会出现也会出现“Too many connections”这个错误,只能关mysql数据库。mysql_pconnect不是永久连接吗,怎么存在这个连接还会去新建?????????????
      

  4.   

    Warning 
    Using persistent connections can require a bit of tuning of your Apache and MySQL configurations to ensure that you do not exceed the number of connections allowed by MySQL.