# Percona MySQL 5.7.20-19 default config file override

**URL:** <https://forums.percona.com/t/percona-mysql-5-7-20-19-default-config-file-override/6182>\
**Category:** Percona Server for MySQL 5.7\
**Created:** [February 8, 2018, 6:44am UTC](https://forums.percona.com/t/percona-mysql-5-7-20-19-default-config-file-override/6182 "2018-02-08T06:44:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zjagust](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/zjagust/32/1212_2.png) [@zjagust](https://forums.percona.com/u/zjagust)\
**Post date:** [February 8, 2018, 6:44am UTC](https://forums.percona.com/t/percona-mysql-5-7-20-19-default-config-file-override/6182/1 "2018-02-08T06:44:53Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![hrvojem](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/hrvojem/32/6_2.png) [@hrvojem](https://forums.percona.com/u/hrvojem)\
**Post date:** [February 19, 2018, 4:45am UTC](https://forums.percona.com/t/percona-mysql-5-7-20-19-default-config-file-override/6182/2 "2018-02-19T04:45:18Z")

</div>

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:

```auto
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:

```auto
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)

```

```auto
root&#64;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

```
