Not the answer you need?
Register and ask your own question!

Percona MySQL 5.7.20-19 default config file override

zjagustzjagust EntrantCurrent User Role Beginner
I have installed a fresh install of Percona MySQL 5.7.20-19 on my Ubuntu 16.04. I have created an override config file initially in /etc/mysql/conf.d named 000-mysqld.cnf with the following options:

[mysqld]

bind-address = 127.0.0.1
datadir = /home/mysql/data
tmpdir = /dev/shm
sql_mode = IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

The only option that gets applied after mysql service restart is bind-address, the rest are ignored and defaults from /etc/mysql/percona-server.conf.d/mysqld.cnf are used.

I tried to move my override file to /etc/mysql/percona-server.conf.d folder, tried to rename it, but nothing helped and still defaults from mysqld.cnf were used. If I comment those options in default mysqld.cnf file, only then options from my override file get applied. My question is how can I override default mysqld.cnf file, is that even possible in Percona Server 5.7?

Comments

  • hrvojemhrvojem Percona Percona Staff Role
    Can you try and rename the config file to something like zz.cnf? I think in this case your config files starting with 000 is being read first, and then values get updated once it reads mysql.cnf

    I've tried adding sql mode to zz.cnf in /etc/mysql/percona-server.conf.d/zz.cnf and restarting the service:

    Before:
    mysql> show variables like 'sql_mode';
    +---------------+------------------------------------------+
    | Variable_name | Value                                    |
    +---------------+------------------------------------------+
    | sql_mode      | STRICT_ALL_TABLES,NO_ENGINE_SUBSTITUTION |
    +---------------+------------------------------------------+
    1 row in set (0.01 sec)
    

    After restart:
    mysql> show variables like 'sql_mode';
    +---------------+-----------------------------------------------------------------------------------------------------------------+
    | Variable_name | Value                                                                                                           |
    +---------------+-----------------------------------------------------------------------------------------------------------------+
    | sql_mode      | IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
    +---------------+-----------------------------------------------------------------------------------------------------------------+
    1 row in set (0.01 sec)
    
    root@artful:~# cat /etc/mysql/percona-server.conf.d/zz.cnf
    [mysqld]
    sql_mode = IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
    
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.