Changes made to my.cnf not working
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.
-
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.. 0 -
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 ? 0 -
Hello, It's possible this relates to the issue described in the previous post. Review the following thread to see if the referenced solution helps: Turn off Mysql Strict Mode Thank you. 0 -
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 0
Please sign in to leave a comment.
Comments
4 comments