SOLVED Changes made to my.cnf not working

yu0307

Registered
Aug 10, 2017
4
1
3
Mississippi
cPanel Access Level
Root Administrator
I wanted to turn on slow query and performance schema, but why after I made changes to the my.cnf (which is in default location, etc/my.cnf) and restarted the server(service mysql restart). From the system variable, my slow query is still off?I use Cpanel WHM 64.0 on CentOS 7.
Below is my my.cnf

------------------------------------------------
[mysqld]
performance-schema=1
default-storage-engine = InnoDB
innodb_file_per_table=1
max_allowed_packet=268435456
open_files_limit=10000
innodb_flush_log_at_trx_commit = 1
innodb_buffer_pool_dump_at_shutdown=1
innodb_write_io_threads = 32
long_query_time = 12
innodb_buffer_pool_load_at_startup=1
innodb_read_io_threads = 32
max_connections = 350
skip-name-resolve=1
query_cache_type = 0
low-priority-updates=1
query_cache_limit = 32M
query_cache_size = 360M
slow-query-log=1
slow_query_log_file = /var/log/mysql/log_slow_query.log
-----------------------------------------------------

none of these are working
skip-name-resolve
low-priority-updates
etc.
 

24x7server

Well-Known Member
Apr 17, 2013
1,911
96
78
India
cPanel Access Level
Root Administrator
Twitter
Hi,

It may be the case where MySQL configuration that is loaded is a different from the default one.

# mysql
mysql> SHOW VARIABLES;


Check what is the actual configuration file loaded by the MySQL on your server..
 

rpvw

Well-Known Member
Jul 18, 2013
1,101
457
113
UK
cPanel Access Level
Root Administrator
I don't know if this is still the case. or even if it is relevant to your platform. Some time ago I had the same experience of changes to the /etc/my.cnf file not taking effect,

As well as an /etc/my.cnf , I found a /usr/my.cnf file that is read after the /etc/my.cnf and editing that file solved my problem.

Perhaps it would be worth the time to check if you have any other cnf files ?
 
Last edited:
  • Like
Reactions: cPanelMichael

yu0307

Registered
Aug 10, 2017
4
1
3
Mississippi
cPanel Access Level
Root Administrator
Thank you all for helping out, Finally the support team found the issue. It was deprecated option string mixed with current version. I in the cnf file, there were settings with "-" rather than "_" which caused mysql skip reading the rest of the settings when encountered. for example, "slow-query-log" suppose to be "slow_query_log" in mysql 5.6. But I guess the important lesson from this instance was rather "Mysql will ignore the rest of the settings if it detects a deprecated setting" which cause the settings afterwards not registering.
Hope this helps for people coming up later
 
  • Like
Reactions: cPanelMichael