# Percona Server dosent read config

**URL:** https://forums.percona.com/t/percona-server-dosent-read-config/34192
**Category:** Percona Server for MySQL 8.0
**Created:** [October 7, 2024, 8:42pm UTC](https://forums.percona.com/t/percona-server-dosent-read-config/34192 "2024-10-07T20:42:30Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![pscloud](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@pscloud](https://forums.percona.com/u/pscloud)
#### Post date: [October 7, 2024, 8:42pm UTC](https://forums.percona.com/t/percona-server-dosent-read-config/34192/1 "2024-10-07T20:42:30Z")

</div>

hey there,

I installed the `percona-server-server` package on Ubuntu 24. I first tried to set the config file before installing the package by using debconf setting the value for `percona-server-server/data-dir` to `/etc/mysql/my.cnf`

But after templating the following things into the file I recognized using `pt-config-diff` that my values arent recognized!

```auto
#
# KEEP YOUR PAWS OFF! THIS FILE IS MANAGED BY ANSIBLE! ANY CHANGES WILL BE OVERWRITTEN! COMMIT CHANGES TO https://bitbucket.org/customer/ansible
#
# You can easily add new config options to the dictionary,
# they will all be rendered (but not checked!). Make sure the options are correct

[mysqld]
basedir = /usr
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
datadir = /var/lib/mysql
default-storage-engine = InnoDB
expire_logs_days = 7
innodb_buffer_pool_instances = 4
innodb_buffer_pool_size = 2G
innodb_file_per_table = 1
innodb_flush_log_at_trx_commit = 1
innodb_flush_method = O_DIRECT
innodb_log_file_size = 256M
innodb_open_files = 4000
join_buffer_size = 2M
log-error = /var/log/mysql/error.log
max_connections = 150
max_heap_table_size = 64M
pid-file = /var/run/mysqld/mysqld.pid
read_buffer_size = 2M
read_rnd_buffer_size = 4M
socket = /var/run/mysqld/mysqld.sock
sort_buffer_size = 2M
sync_binlog = 1
table_open_cache = 2000
tmp_table_size = 64M
tmpdir = /tmp
user = mysql

```

```auto
[22:40:15] root@customer-ansible: /etc/mysql # pt-config-diff localhost /etc/mysql/my.cnf
16 config differences
Variable customer-ansible /etc/mysql/mysql.conf.d/ow
========================= ========================= =========================
collation_server utf8mb4_0900_ai_ci utf8mb4_unicode_ci
expire_logs_days 0 7
innodb_buffer_pool_ins... 1 4
innodb_buffer_pool_size 134217728 2147483648
innodb_flush_method fsync O_DIRECT
innodb_log_file_size 50331648 268435456
join_buffer_size 262144 2097152
log_error stderr /var/log/mysql/error.log
max_connections 151 150
max_heap_table_size 16777216 67108864
pid_file /var/lib/mysql/medizin... /var/run/mysqld/mysqld...
read_buffer_size 131072 2097152
read_rnd_buffer_size 262144 4194304
sort_buffer_size 262144 2097152
table_open_cache 4000 2000
tmp_table_size 16777216 67108864

```

I also tried using a seperate override file in `/etc/mysql/mysql.conf.d/own.cnf` but this also dosent have an effect after stopping and starting mysql. What am I doing wrong?

best, pscloud

---

<div class="post-metadata">

### Author: ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)
#### Post date: [October 7, 2024, 10:00pm UTC](https://forums.percona.com/t/percona-server-dosent-read-config/34192/2 "2024-10-07T22:00:10Z")

</div>

Check /etc/my.cnf and other .cnf files for possible conflicts of @include which might have paths that you are not using.

---

<div class="post-metadata">

### Author: ![pscloud](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@pscloud](https://forums.percona.com/u/pscloud)
#### Post date: [October 8, 2024, 6:13am UTC](https://forums.percona.com/t/percona-server-dosent-read-config/34192/3 "2024-10-08T06:13:43Z")

</div>

I checked all the files and dirs. `/etc/my.cnf` does not exist, so according to the output of `mysql --help --verbose` the next one is `/etc/mysql/my.cnf`

This file says:

```auto
#
# The Percona Server 8.0 configuration file.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
#
#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/

```

Even when I replace this file with the content or I put my own file under one of these dirs, mysql doesent use my config options.

---

<div class="post-metadata">

### Author: ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)
#### Post date: [October 8, 2024, 3:59pm UTC](https://forums.percona.com/t/percona-server-dosent-read-config/34192/4 "2024-10-08T15:59:58Z")

</div>

Check the value of update-alternatives for my.cnf There might be a hidden override. I’m not well versed in this tool, so you’ll have to do some google-foo.

---

<div class="post-metadata">

### Author: ![pscloud](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@pscloud](https://forums.percona.com/u/pscloud)
#### Post date: [October 8, 2024, 7:02pm UTC](https://forums.percona.com/t/percona-server-dosent-read-config/34192/5 "2024-10-08T19:02:34Z")

</div>

I checked it before I wrote and double checked it now. When I put my config in these files it isnt recognized by mysql as well…

```auto
[21:00:57] root@customer-ansible: ~ # update-alternatives --list my.cnf
/etc/mysql/my.cnf.fallback
/etc/mysql/mysql.cnf

```

---

<div class="post-metadata">

### Author: ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)
#### Post date: [October 8, 2024, 7:45pm UTC](https://forums.percona.com/t/percona-server-dosent-read-config/34192/6 "2024-10-08T19:45:52Z")

</div>

run mysqld --help --verbose and it should tell you if it was able to parse the file and show you, at the bottom, any parameters that were changed as a result of the file parsing. Or, might show an error if it cannot read them.

---

<div class="post-metadata">

### Author: ![pscloud](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@pscloud](https://forums.percona.com/u/pscloud)
#### Post date: [October 9, 2024, 5:29am UTC](https://forums.percona.com/t/percona-server-dosent-read-config/34192/7 "2024-10-09T05:29:44Z")

</div>

Couldn’t find that part telling if its able to read the config file. Thats the output, variables and startup options are cut out.

```auto
[21:05:45] root@customer-ansible: ~ # mysqld --help --verbose
mysqld Ver 8.0.37-29 for Linux on aarch64 (Percona Server (GPL), Release '29', Revision '30dc4e71')
BuildID[sha1]=2044d59fc805795fa10146592a6a19e3f9b12e68
Copyright (c) 2009-2024 Percona LLC and/or its affiliates
Copyright (c) 2000, 2024, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Starts the MySQL database server.

Usage: mysqld [OPTIONS]

Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf
The following groups are read: mysql_cluster mysqld server mysqld-8.0

[...]

To see what values a running MySQL server is using, type
'mysqladmin variables' instead of 'mysqld --verbose --help'.

```

When I look at the order I’m confused that its not loaded. Theres no /etc/my.cnf so it must load /etc/mysql/my.cnf but it dosent. I double checked with writing some weird nonesense in the config file, but mysql starts without complaining. So I think it dosen’r recognize this file…

When I use `/etc/my.cnf` now it uses the config. But I can’t see why its not using `/etc/mysql/my.cnf` when the first one isnt available

---

<div class="post-metadata">

### Author: ![Evgeniy\_Patlan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/evgeniy_patlan/32/41_2.png) [@Evgeniy\_Patlan](https://forums.percona.com/u/Evgeniy_Patlan)
#### Post date: [October 9, 2024, 11:12am UTC](https://forums.percona.com/t/percona-server-dosent-read-config/34192/8 "2024-10-09T11:12:12Z")

</div>

Could you please try without using debcon to set values as for me it worked well

---

<div class="post-metadata">

### Author: ![pscloud](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@pscloud](https://forums.percona.com/u/pscloud)
#### Post date: [October 24, 2024, 1:55pm UTC](https://forums.percona.com/t/percona-server-dosent-read-config/34192/9 "2024-10-24T13:55:51Z")

</div>

I’m sorry, I haven’t had time to work on this the last two weeks. I tried it on a fresh, manually installed server - and surprise, same problem ☹

---

<div class="post-metadata">

### Author: ![jinyou.ma](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jinyou.ma/32/19714_2.png) [@jinyou.ma](https://forums.percona.com/u/jinyou.ma)
#### Post date: [December 19, 2025, 12:03am UTC](https://forums.percona.com/t/percona-server-dosent-read-config/34192/10 "2025-12-19T00:03:08Z")

</div>

@pscloud

Can you please use strace to confirm whether the mysqld reads your own configuration file?

- start mysqld with strace on session 1

```auto
~]# strace -e openat -o open.log mysqld --user=mysql

```

- stop mysqld on session 2

```auto
~]# mysqladmin shutdown

```

- check strace log

```auto
~]# grep own open.log
openat(AT_FDCWD, "/etc/mysql/mysql.conf.d/own.cnf", O_RDONLY) = 4

```
