服务器出现这个问题好久了, 间隔一段时间出现数据库连接不上的问题,7天左右正常,然后又出现这个问题,只有重新启动服务器,在网上找了很多方法,没用,什么connnect改成pconnect,修改系统的回收资源的时间,前段时间怀疑是有人搞破坏,我把MYSQL的数据库端口改掉了,但是问题依旧,MYSQL的连接数也修改了,网站的访问量不大但是反反复复出现这问题,不行啊,怎么解决,来点可行的办法,程序里面肯定是做到了所有的连接后调用CLOSE方法关闭连接,万一就算没关闭Pconnect,它也会自己断开的吧,而且这网站访问量不大200 IP 左右,不足以导致这个问题吧,
 mysql5.1 +PHP  IIS作为WEB服务器 系统windows 2003  网站:http://www.networkesl.com
实际的解决方法,这个我查了很多了,理论的问题大家都知道,就别再贴了就是数据库连接过多引起的溢出。
大家帮忙看看。

解决方案 »

  1.   

    我会检查出问题的时候到底有多少连接,如果是合理的,我会增加可用连结数,如果是不合理的,也可以看见有哪些连接是不正常的,然后看看怎么消除不正常的连接。对IIS不熟,比如是apache,如果apache本身就设定了最大50个进程,而mysql设定最大连接是30,那自然过一点时间就会出问题了。
      

  2.   

    以前只是针对所有的操作进行了记录,包括所有的查询,对执行比较慢的操作进行了记录,每次统计下来有几千行,分析起来是比较困难,这次对记录进行了细化,如下:log-error=log-error.log
    log=log-query.log
    log-queries-not-using-indexes
    log-warnings=2
    log-slow-queries=log-slow-query.log
    log-update=log-update.log
    long_query_time=2希望大家能补充一下,是否可以捕捉到详细的错误信息。
      

  3.   

    参考一下
    http://www.adamghost.com/?p=76
    看看有无帮助
      

  4.   

    我在my.ini里面配置了错误日志,但是没见到记录,再补充些线索,
    我操作数据库的时候我用的是EMS, 很多时候都是EMS连接不上数据库,弹出10055错误,而且用mysql字符窗口也登陆不上去,但是前台的网站里面却有数据。
    何解?那个日志我是最近重新些的,把之前的所有操作记录的日志弄了,然后重新启动了mysql服务,是否重新启动服务器才起效呢?
      

  5.   

    OK。这里是error日志  
    081208  9:17:31  InnoDB: Started; log sequence number 0 51949
    081208  9:17:31 [Note] C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt: ready for connections.
    Version: '5.0.45-community-nt-log'  socket: ''  port: 8573  MySQL Community Edition (GPL)
    081208  9:17:42081208  9:17:42 [ERROR] Cannot find table networkesl/ahl_allow_summer from the internal data dictionary
    of InnoDB though the .frm file for the table exists. Maybe you
    have deleted and recreated InnoDB data files but have forgotten
    to delete the corresponding .frm files of InnoDB tables, or you
    have moved .frm files to another database?
    See http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html
    how you can resolve the problem.081208  9:17:42081208  9:17:42 [ERROR] Cannot find table networkesl/ahl_allow_summer from the internal data dictionary
    of InnoDB though the .frm file for the table exists. Maybe you
    have deleted and recreated InnoDB data files but have forgotten
    to delete the corresponding .frm files of InnoDB tables, or you
    have moved .frm files to another database?
    See http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html
    how you can resolve the problem.081208  9:17:43081208  9:17:43 [ERROR] Cannot find table networkesl/ipaddress from the internal data dictionary
    of InnoDB though the .frm file for the table exists. Maybe you
    have deleted and recreated InnoDB data files but have forgotten
    to delete the corresponding .frm files of InnoDB tables, or you
    have moved .frm files to another database?
    See http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html
    how you can resolve the problem.081208  9:17:43081208  9:17:43 [ERROR] Cannot find table networkesl/ipaddress from the internal data dictionary
    of InnoDB though the .frm file for the table exists. Maybe you
    have deleted and recreated InnoDB data files but have forgotten
    to delete the corresponding .frm files of InnoDB tables, or you
    have moved .frm files to another database?
    See http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html
    how you can resolve the problem.081209  8:33:09 [Note] C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt: Normal shutdown081209  8:33:13 [Warning] C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt: Forcing close of thread 7  user: 'root'081209  8:33:13 [Warning] C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt: Forcing close of thread 6  user: 'root'081209  8:33:13 [Warning] C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt: Forcing close of thread 5  user: 'root'081209  8:33:13 [Warning] C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt: Forcing close of thread 3  user: 'root'081209  8:33:14  InnoDB: Starting shutdown...
    081209  8:33:18  InnoDB: Shutdown completed; log sequence number 0 51949
    081209  8:33:18 [Note] C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt: Shutdown complete081209  8:35:21  InnoDB: Started; log sequence number 0 51949
    081209  8:35:34 [Note] C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt: ready for connections.
    Version: '5.0.45-community-nt-log'  socket: ''  port: 8573  MySQL Community Edition (GPL)
      

  6.   

    ahl_allow_summer和IP地址的 表是已经修正过了,下面的错误,刚才在网上看到和360安全卫士有关,卸载了,
    等待错误中......
      

  7.   

    081208  9:17:42081208  9:17:42 [ERROR] Cannot find table networkesl/ahl_allow_summer from the internal data dictionary

    这个不是错误吗?好好检查一下你的这个表在哪里
      

  8.   

    这两个表是因为那个,新建表的时候大多数用的是MyISAM 这个类型,我接替这个项目的时候一开始新建的几个表用的是InnoDB 类型,所以会出现这个问题。后来我又统一的修过过了,这两个表遗漏了, 谢谢(yueliangdao0608 )  我也还在武汉混。 
    继续关注。 
     
      

  9.   


    MySQL官方手册中建议不要把INNODB 直接转化为MYISAM.
    因为这个操作他们本身没有试验过。
      

  10.   

    INNODB 直接转化为MYISAM
    我直接转化过,问题不大。但是有一点,感觉innodb表用的那个大文件,空间释放的不够彻底,有残留。
    但是,也没有办法。