Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10061) in G:\XXXX\XXXX\www\includes\db.inc.php on line 25Warning: mysql_get_server_info() [function.mysql-get-server-info]: Access denied for user 'ODBC'@'localhost' (using password: NO) in G:\XXXX\XXXX\www\includes\db.inc.php on  line 75Warning: mysql_get_server_info() [function.mysql-get-server-info]: A link to the server could not be established in G:\XXXX\XXXX\www\includes\db.inc.php on line 75
Mysql version can not be less than 4.1
偶尔出现这个提示,不是一直。换了127.0.0.1没用,换了数据库版本还是这样,程序在别的服务器是好的,请问我的服务器是哪里设置不对啊?各位帮帮忙谢谢!

解决方案 »

  1.   

    MySQL服务非正常停止了吧,检查一下MySQL错误日志。
      

  2.   

    就是mysql安装目录下的一个文本文件,默认的名称是主机名.err。
      

  3.   

    InnoDB: The first specified data file .\ibdata1 did not exist:
    InnoDB: a new database to be created!
    110414  7:50:42  InnoDB: Setting file .\ibdata1 size to 10 MB
    InnoDB: Database physically writes the file full: wait...
    110414  7:50:42  InnoDB: Log file .\ib_logfile0 did not exist: new to be created
    InnoDB: Setting log file .\ib_logfile0 size to 71 MB
    InnoDB: Database physically writes the file full: wait...
    110414  7:50:45  InnoDB: Log file .\ib_logfile1 did not exist: new to be created
    InnoDB: Setting log file .\ib_logfile1 size to 71 MB
    InnoDB: Database physically writes the file full: wait...
    InnoDB: Doublewrite buffer not found: creating new
    InnoDB: Doublewrite buffer created
    InnoDB: Creating foreign key constraint system tables
    InnoDB: Foreign key constraint system tables created
    110414  7:50:46  InnoDB: Started; log sequence number 0 0
    110414  7:50:46 [Note] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: ready for connections.
    Version: '5.0.45-community-nt'  socket: ''  port: 3306  MySQL Community Edition (GPL)
    110414 11:37:31 [Note] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: Normal shutdown110414 11:37:31  InnoDB: Starting shutdown...
    110414 11:37:33  InnoDB: Shutdown completed; log sequence number 0 43655
    110414 11:37:33 [Note] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: Shutdown complete110414 11:37:34  InnoDB: Started; log sequence number 0 43655
    110414 11:37:35 [Note] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: ready for connections.
    Version: '5.0.45-community-nt'  socket: ''  port: 3306  MySQL Community Edition (GPL)
    110414 11:41:43 [Note] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: Normal shutdown110414 11:41:43  InnoDB: Starting shutdown...
    110414 11:41:45  InnoDB: Shutdown completed; log sequence number 0 43655
    110414 11:41:45 [Note] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: Shutdown complete110414 11:41:47  InnoDB: Started; log sequence number 0 43655
    110414 11:41:47 [Note] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: ready for connections.
    Version: '5.0.45-community-nt'  socket: ''  port: 3306  MySQL Community Edition (GPL)
    110414 11:46:59 [Note] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: Normal shutdown110414 11:46:59  InnoDB: Starting shutdown...
    110414 11:47:01  InnoDB: Shutdown completed; log sequence number 0 43655
    110414 11:47:01 [Note] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: Shutdown complete110414 11:47:03  InnoDB: Started; log sequence number 0 43655
    110414 11:47:03 [Note] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: ready for connections.
    Version: '5.0.45-community-nt'  socket: ''  port: 3306  MySQL Community Edition (GPL)
    110419 12:48:38 [Note] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: Normal shutdown110419 12:48:40 [Warning] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: Forcing close of thread 519414  user: 'uudog'110419 12:48:40 [Warning] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: Forcing close of thread 505319  user: 'uudog'110419 12:48:40 [Warning] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: Forcing close of thread 503630  user: 'uudog'110419 12:48:40 [Warning] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: Forcing close of thread 503623  user: 'uudog'110419 12:48:40  InnoDB: Starting shutdown...
    110419 12:48:43  InnoDB: Shutdown completed; log sequence number 0 43655
    110419 12:48:43 [Note] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: Shutdown complete110419 12:48:45  InnoDB: Started; log sequence number 0 43655
    110419 12:48:46 [Note] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: ready for connections.
    Version: '5.0.45-community-nt'  socket: ''  port: 3306  MySQL Community Edition (GPL)
    110420  0:06:54 [Note] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: Normal shutdown110420  0:06:57  InnoDB: Starting shutdown...
    110420  0:07:00  InnoDB: Shutdown completed; log sequence number 0 43655
    110420  0:07:00 [Note] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: Shutdown complete110420  0:08:36  InnoDB: Started; log sequence number 0 43655
    110420  0:08:39 [Note] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: ready for connections.
    Version: '5.0.45-community-nt'  socket: ''  port: 3306  MySQL Community Edition (GPL)
    110429 23:08:45 [Note] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: Normal shutdown110429 23:08:47  InnoDB: Starting shutdown...
    110429 23:08:49  InnoDB: Shutdown completed; log sequence number 0 43655
    110429 23:08:49 [Note] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: Shutdown complete110429 23:10:41  InnoDB: Started; log sequence number 0 43655
    110429 23:10:45 [Note] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: ready for connections.
    Version: '5.0.45-community-nt'  socket: ''  port: 3306  MySQL Community Edition (GPL)
    110430  8:07:07 [Note] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: Normal shutdown110430  8:07:09 [Warning] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: Forcing close of thread 20086  user: 'uudog'110430  8:07:09 [Warning] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: Forcing close of thread 19213  user: 'uudog'110430  8:07:09 [Warning] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: Forcing close of thread 19212  user: 'uudog'110430  8:07:10  InnoDB: Starting shutdown...
    110430  8:07:17  InnoDB: Shutdown completed; log sequence number 0 43655
    110430  8:07:17 [Note] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: Shutdown complete110430  8:08:49  InnoDB: Started; log sequence number 0 43655
    110430  8:08:52 [Note] D:\xxxx\MySQL Server 5.0\bin\mysqld-nt: ready for connections.
    Version: '5.0.45-community-nt'  socket: ''  port: 3306  MySQL Community Edition (GPL)
      

  4.   

    是不是并发连接数太高导致的啊,看看连接情况:
    mysql>SHOW STATUS LIKE '%connect%';
      

  5.   

    看下mysql.user中'uudog'这个用户有什么限制
      

  6.   


    Enter password: ****************************
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 407365
    Server version: 5.0.45-community-nt MySQL Community Edition (GPL)Type 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql> SHOW STATUS LIKE '%connect%';
    +--------------------------+--------+
    | Variable_name            | Value  |
    +--------------------------+--------+
    | Aborted_connects         | 105    |
    | Connections              | 407372 |
    | Max_used_connections     | 9      |
    | Ssl_client_connects      | 0      |
    | Ssl_connect_renegotiates | 0      |
    | Ssl_finished_connects    | 0      |
    | Threads_connected        | 7      |
    +--------------------------+--------+
    7 rows in set (0.00 sec)
      

  7.   


    Enter password: ****************************
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 165
    Server version: 5.0.45-community-nt MySQL Community Edition (GPL)Type 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql> show processlist;
    +-----+------+----------------+------+---------+------+-------+-----------------
    -+
    | Id  | User | Host           | db   | Command | Time | State | Info
     |
    +-----+------+----------------+------+---------+------+-------+-----------------
    -+
    | 165 | root | localhost:1676 | NULL | Query   |    0 | NULL  | show processlist
     |
    +-----+------+----------------+------+---------+------+-------+-----------------
    -+
    1 row in set (0.02 sec)mysql>
      

  8.   

    谢谢楼上的两位朋友,已经解决了,下面把方法贴出来,方便后来人。=============================================================MYSQL 偶尔掉线 如果你是WINDOWS系统  那么可能是系统补丁造成的进入控制面板 --- 添加和删除程序 (要勾选上方的“显示更新”),找到KB967723这个补丁,然后卸载掉。卸载中会提示你,如果卸载可能导致程序运行出错,没关系,选择“是”,继续卸载。重启服务器, 卸载掉这个补丁问题就可以解决了!=============================================================