我程序在连接mysql时有报错:
ConnectDB: error: Can't connect to MySQL server on '127.0.0.1' (99)我是调用的mysql的c api mysql_error(&m_connection)打印的上面的错误,括号里的99是什么意思呢?而且这个报错一遍只需一分钟,然后就自动好了(又能连上了)谁知道是怎么回事啊?

解决方案 »

  1.   

    http://topic.csdn.net/u/20090920/22/14d4f597-b7d4-4c24-b0db-abb2956e66c3.html参考一下这个贴子中的检查方法。贴出你的检查结果。
      

  2.   


    这个错误一般很少见。有一种解释是你可用端口当时分配失败造成的。参考网上的一篇讨论。(看看回文及原帖)
    http://lists.mysql.com/mysql/204831
      

  3.   

    谢谢iihero。
    我的这种连接错误出现在远程连接而且mysql比较忙的时候,请问有没有什么方法可以解决呢?
      

  4.   


    检查一下你的最大连接数是多少mysql> show variables like 'max_connections';
    +-----------------+-------+
    | Variable_name   | Value |
    +-----------------+-------+
    | max_connections | 100   |
    +-----------------+-------+
    1 row in set (0.00 sec)mysql>
      

  5.   


    最大链接数是2000
    mysql> show variables like 'max_connections';
    +-----------------+-------+
    | Variable_name   | Value |
    +-----------------+-------+
    | max_connections | 2000  |
    +-----------------+-------+
    1 row in set (0.00 sec)
      

  6.   

    show status like '%conn%';贴出来看一下。