mariadbgalera

In which conf file does MariaDB/Galera store the datadir parameter


I've installed a mariaDB Galera cluster version 11.0.3 on Hetzner instances running Debian 11. All goes fine.

For the definitive config I need to setup a dedicated volume for the data and thus change the datadir parameter in a configuration file. So far I didn't care very much about it, but I just realized that I can't find an uncommented line datadir = /var/lib/mysql.in any of the *.cnf so that I can change it.

The question is: where is the datdadir parameter defined if it's no in either of

/etc/mysql/mariadb.cnf
/etc/mysql/mariadb.conf.d/50-mariadb_safe.cnf
/etc/mysql/mariadb.conf.d/50-server.cnf
/etc/mysql/mariadb.conf.d/60-galera.cnf

Or, maybe, is /var/lib/mysql the default value ?

Thanks in advance for your advices


Solution

  • /var/lib/mysql is the current default, however you can always check with:

    mariadbd --help --verbose
    

    Take a note at the top of this output the config files read.

    To pull out the items in configuration files:

    my_print_defaults --mariadbd
    

    On a running system:

    SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
    

    Or for datadir directly:

    SELECT @@datadir;