Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the configuration file of MariaDB?

Tags:

I'm using stand-alone database on Debian, and I'm new to MariaDB. In MySQL, I used to deal with only one my.cnf which contained all relevant parameters that I needed.

Here, in MariaDB 10, there are dozens of them:

/etc/mysql# tree
.
├── conf.d
│   ├── mysql.cnf
│   └── mysqldump.cnf
├── debian.cnf
├── debian-start
├── mariadb.cnf
├── mariadb.conf.d
│   ├── 50-client.cnf
│   ├── 50-mysql-clients.cnf
│   ├── 50-mysqld_safe.cnf
│   └── 50-server.cnf
├── my.cnf -> /etc/alternatives/my.cnf
└── my.cnf.fallback

I need to modify parameters like max_connections, innodb_buffer_pool_size and long_query_time to register slow queries. I added them to my.cnf but then the server refused to restart.

So I'm wondering what file should I modify?

like image 500
Milkyway Avatar asked Dec 31 '19 17:12

Milkyway


1 Answers

To check which configuration files are processed by the server, just execute

$ /path_to_mysqld/mysqld --help --verbose

At the beginning of output you will find information about configuration files, e.g.

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

Please note, that a setting might be overwritten, e.g. if /etc/my.cnf contains the value val=1, but ~/my.cnf contains val=3.

Since you mentioned that the server refused to start, you likely added your changes to the right file, but the settings are incorrect. In this case you should check the error log in your data directory.

like image 119
Georg Richter Avatar answered Nov 15 '22 05:11

Georg Richter