请问我用/usr/local/mysql/bin/mysqladmin extended-status 查看的
 aborted-client
 aborted-connection分别是设么意思
 aborted-client是未释放的连接吗? 我用apache+mysql + linux + php 当我通过SSH工具连接服务器,打开mysql,进入命令行,同时刷新php页面,会看到aborted-client会不停增加。
但是,如果我在服务器端不进入mysql命令行(mysql>...),刷新页面,aborted-client就不变.请问,这是什么原因啊???是页面没有释放连接吗?但是我在服务器端不进入mysql命令行(mysql>...),客户浏览器刷新页面,aborted-client就不变啊。

解决方案 »

  1.   

    Aborted_clients 少了个s估计, 是由于你的用户联接使用完后没有自己释放而被MYSQL强行关闭的连接数。
    Aborted_connects  未成功的试图的连接次数。
    检查一下你的PHP,中有没有对打开折连接进行close ?
    mysql_close($link);
    
      

  2.   

    我定义了一个db.php
    然后用一个DB类,提供connect()方法
    在类的析构方法中加了mysql_close($link)。在使用时都是$db = new DB(); $db->connect();的方式。这样有问题吗?关键是当我通过SSH工具连接服务器,打开mysql,进入命令行,同时刷新php页面,会看到aborted-clients会不停增加。 
    但是,如果我在服务器端不进入mysql命令行(mysql>...),刷新页面,aborted-clients就不变. 
      

  3.   

    这些Aborted_clients  的记录你可以在服务器的错误日志中看到说明比如010301 14:38:23  Aborted connection 854 to db: 'users' user: 'josh'造成的原因一般有
    1. 没有 call mysql_close() 
    2. 进程进入休眠状态过长,导致timeout, wait_timeout  变量设置
    3. 程序异常中断。
      

  4.   

    我看了下错误日志报如下信息:
    090622 23:39:52 [Warning] option 'max_connect_errors': unsigned value 0 adjusted
     to 1
    090622 23:39:52  InnoDB: Started; log sequence number 0 762295
    090622 23:39:52 [ERROR] Column count of mysql.db is wrong. Expected 22, found 20
    . Created with MySQL 50040, now running 50135. Please use mysql_upgrade to fix t
    his error.
    090622 23:39:52 [ERROR] mysql.user has no `Event_priv` column at position 29
    090622 23:39:52 [ERROR] Event Scheduler: An error occurred when initializing sys
    tem tables. Disabling the Event Scheduler.
    090622 23:39:52 [Note] /usr/sbin/mysqld: ready for connections.
    Version: '5.1.35-community-log'  socket: '/tmp/mysql.sock'  port: 3306  MySQL Co
    mmunity Server (GPL)
    另外我的my.cnf配置如下:
    [client]
    #password       = your_password
    port            = 3306
    socket          = /tmp/mysql.sock
    default-character-set=utf8# Here follows entries for some specific programs# The MySQL server
    [mysqld]
    port            = 3306
    socket          = /tmp/mysql.sock
    skip-locking
    safe-show-database
    key_buffer = 256M
    join_buffer=64M
    max_allowed_packet = 64M
    table_cache =512
    sort_buffer_size = 128M
    net_buffer_length = 8K
    read_buffer_size = 64M
    read_rnd_buffer_size = 64M
    myisam_sort_buffer_size = 64M
    query_cache_limit=1M
    query_cache_size=32MB
    query_cache_type=1
    max_user_connections=2000
    max_connections=5000
    max_connect_errors=0
    interactive_timeout=10
    wait_timeout=120
    connect_timeout=20
    thread_cache_size=128
    thread_concurrency=2
    record_buffer=1M
    #log_slow_queries=/var/log/mysql-slow_queries.log
    slow_query_log=ON
    slow_query_log_file=/var/log/mysql-slow_queries.log
    long_query_time=2
    default-character-set=utf8
    collation-server=utf8_general_ci
    # Replication Master Server (default)
    # binary logging is required for replication
    log-bin=mysql-bin# required unique id between 1 and 2^32 - 1
    # defaults to 1 if master-host is not set
    # but will not function as a master if omitted
    server-id       = 1[mysqldump]
    quick
    max_allowed_packet = 16M[mysql]
    no-auto-rehash
    # Remove the next comment character if you are not familiar with SQL
    #safe-updates[isamchk]
    key_buffer = 32M
    sort_buffer_size = 32M
    read_buffer = 16M
    write_buffer = 16M[myisamchk]
    key_buffer = 128M
    sort_buffer_size = 128M
    read_buffer = 16M
    write_buffer = 16M[mysqlhotcopy]
    interactive-timeout
      

  5.   

    max_connect_errors=0改成max_connect_errors=10
      

  6.   

    但是当我通过SSH工具连接服务器,打开mysql,进入命令行,同时刷新php页面,还会看到aborted-clients会不停增加。
      

  7.   

    改成
    max_connect_errors=10之后如果还是这样情况,那么再看一下错误日志中的提示。
      

  8.   


    干掉是什么意思?比如aborted-client=50
    max_connections = 100那么只剩下 100 - 50 个可用连接了吗?
      

  9.   

    我已经改成了20运行时mysql没报错,错误日志里面也没有相关的错误信息。但是看着mysql 命令行,再客户浏览器刷php页面,再看status,aborted-client 还是涨。
    但是退出mysql 命令行。再在客户浏览器刷php页面,再看status,aborted-client 就不涨了。这是什么原因啊、是正常现象吗?
      

  10.   

    是不是你自己的SSH有问题啊,打开两个SSH看一下是否涨。不去刷新PHP.