我的mySQL服务器不尊重15秒的wait_timeout或interactive_timeout查询只会继续并超过相应的15秒。下面是my.cnf -
[mysqld]
# Settings user and group are ignored when systemd is used (fedora >= 15).
# If you need to run mysqld under different user or group,
# customize your systemd unit file for mysqld according to the
# instructions in http://fedoraproject.org/wiki/Systemd
user=mysql
#skip-innodb
#ignore-builtin-innodb
#default-storage-engine = myisam
#log-queries-not-using-indexes
#key_buffer = 6M
key_buffer_size = 1024M
max_allowed_packet = 64M
thread_stack = 256K
thread_cache_size = 200
max_connections = 200
table_cache = 128K
tmp_table_size = 24M
max_heap_table_size = 24M
join_buffer_size = 1M
query_cache_limit = 32M
query_cache_size = 8M
read_buffer_size = 1M
# concurrent_insert = ALWAYS
general_log = 0
general_log_file = /var/log/mysql/general.log
low_priority_updates=1
log_warnings=2
#log_error=/var/log/mysql/mysql_error.log
slow-query-log = 1
slow-query-log-file = /var/log/mysql/mysql-slow.log
long_query_time=1
wait_timeout=15
interactive_timeout=15
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# InnoDB Settings
innodb_buffer_pool_size = 768M
innodb_log_file_size = 100M
innodb-file-per-table = 1
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Semisynchronous Replication
# http://dev.mysql.com/doc/refman/5.5/en/replication-semisync.html
# uncomment next line on MASTER
#;plugin-load=rpl_semi_sync_master=semisync_master.so
# uncomment next line on SLAVE
#;plugin-load=rpl_semi_sync_slave=semisync_slave.so
# Others options for Semisynchronous Replication
#;rpl_semi_sync_master_enabled=1
#;rpl_semi_sync_master_timeout=10
#;rpl_semi_sync_slave_enabled=1
# http://dev.mysql.com/doc/refman/5.5/en/performance-schema.html
#;performance_schema
#log-queries-not-using-indexes
default-storage-engine=MyISAM
#log-queries-not-using-indexes
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
我在服务器上运行命令,但是当我执行mytop -时,有超过15秒的查询。
mysql> select @@global.wait_timeout, @@session.wait_timeout;
+-----------------------+------------------------+
| @@global.wait_timeout | @@session.wait_timeout |
+-----------------------+------------------------+
| 15 | 15 |
+-----------------------+------------------------+
1 row in set (0.00 sec)
你知道我做错了什么吗?
wait_timeout
文档如下:
服务器等待活动的秒数关闭之前的非交互式连接。此超时只适用于TCP/IP和Unix套接字文件连接,而不是进行的连接使用命名管道或共享内存
从你的问题听起来像是你试图使用它和interactive_timeout
突然放弃长时间运行的查询。但这不是它的目的。