skip to Main Content

The server is working on CentOS 8, I’m trying to configure MariaDB by making alterations to /etc/my.cnf but then when I restart DB by doing sudo systemctl restart mariadb, the server does restart but no configuration changes get applied.

mysql > SHOW VARIABLES;

It outputs the same values. I tried to comment out the including directive #!includedir /etc/my.cnf.d and to add settings to [mysqld] and [mariadb] sections.

mysql --verbose --help says:

Default options are read from the following files in the given order:
/etc/my.cnf ~/.my.cnf.

The following groups are read: mysql client client-server client-mariadb

2

Answers


  1. Chosen as BEST ANSWER

    Check whether mysql uses the config file debugging it with strace:

    sudo strace mysql
    

    In the strace output, look for lines like:

    openat(AT_FDCWD, "/etc/my.cnf", O_RDONLY|O_CLOEXEC) = ...
    

    Make sure openat doesn't return -1. In that case check whether the file exists or mysql has enough permissions to read the file.


  2. When adding additional configuration files, make sure that they are not writable by ‘other’. Otherwise you’ll have a message on mysql startup like:

    Warning: World-writable config file ‘/etc/mysql/conf.d/myproject.cnf’ is ignored

    and the configuration does not get applied.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search