Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SOLVED Changes made to my.cnf not working

Discussion in 'Database Discussions' started by yu0307, Aug 10, 2017.

  1. yu0307

    yu0307 Registered

    Joined:
    Aug 10, 2017
    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    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.
     
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,484
    Likes Received:
    60
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
    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..
     
  3. rpvw

    rpvw Well-Known Member

    Joined:
    Jul 18, 2013
    Messages:
    327
    Likes Received:
    94
    Trophy Points:
    28
    Location:
    Spain
    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 ?
     
    #3 rpvw, Aug 11, 2017
    Last edited: Aug 11, 2017
    cPanelMichael likes this.
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
  5. yu0307

    yu0307 Registered

    Joined:
    Aug 10, 2017
    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    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
     
    cPanelMichael likes this.
Loading...

Share This Page