3

I have a MySQL 5.5 instance running on a RedHat distro. I have edited my.cnf with the following setting:

wait_timeout=30

However, client connections are sleeping and never getting killed. The server has been restarted with the new setting in place.

What am I not understanding?

my.cnf:

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
performance_schema=off
innodb_buffer_pool_size=64M

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

wait_timeout = 30

key_buffer      = 16M
max_allowed_packet  = 16M
thread_stack        = 192K
thread_cache_size       = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover         = BACKUP
#max_connections        = 500
#table_cache            = 64
#thread_concurrency     = 10
#
# * Query Cache Configuration
#
query_cache_limit   = 1M
query_cache_size        = 16M


expire_logs_days    = 10
max_binlog_size         = 100M

bind-address=192.168.0.11
interactive_timeout = 60
max_connections = 500

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid



[isamchk]
key_buffer      = 16M

EDIT

Interestingly per @RolandMySQLDBA comments:

enter image description here

It appears none of the cnf file settings are being considered.

and the proof:

[root@localhost ~]# locate my.cnf
/etc/my.cnf
/opt/rh/mysql55/root/etc/my.cnf
  • Please post your my.cnf into the question. – RolandoMySQLDBA Oct 24 '14 at 18:30
  • @RolandoMySQLDBA Done. – Roy Hinkley Oct 24 '14 at 18:37
  • 1
    Run the following: SELECT * FROM information_schema.global_variables WHERE variable_name='wait_timeout' UNION SELECT * FROM information_schema.session_variables WHERE variable_name='wait_timeout'; What comes back, one row or two ? – RolandoMySQLDBA Oct 24 '14 at 18:41
  • @RolandoMySQLDBA 1 row containing WAIT_TIMEOUT with a value of 28800 – Roy Hinkley Oct 24 '14 at 18:43
  • two row is coming, and did not changed is for session_variables – Ramratan Gupta Jun 21 '18 at 13:14
1

My immediate suspicion is that there is another my.cnf present on the system. You should run

locate my.cnf

and see if the reports multiple my.cnf files

If there is only one my.cnf, then my.cnf is most likely in the wrong folder.

It should be in one of the following places

  • /etc/my.cnf
  • /etc/mysql/my.cnf
  • /var/lib/mysql/my.cnf
  • ~/my.cnf

Please check for these. Remove extras.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.