I have an Ubuntu 16.04 server (VPS), I installed MariaDb 10.1 on it (did it like the doc said). I would like to configure the database server, so innodb can use 2-4GB memory, so I tried to find the sample my.cnf's in /usr/share/mysql/ but not a single one is there (only these). Where can I find the sample configurations and how can I make them the actual? I read the the /etc/mysql/mysql.conf.d/ dir should contain a mysqld.cnf, but for me there is only these files:

50-client.cnf  50-mysql-clients.cnf  50-mysqld_safe.cnf  50-server.cnf  50-server.cnf.backup

Which one is active? My guess is none.

I don't need anything special, that is why I wanted to just actualize the my-huge.cnf and be done.

share|improve this question
up vote 0 down vote accepted

All these configurations are applied. Here's the full directory structure:

$ tree -f /etc/mysql
  /etc/mysql
  ├── /etc/mysql/conf.d
  │   ├── /etc/mysql/conf.d/mariadb.cnf
  │   └── /etc/mysql/conf.d/mysqld_safe_syslog.cnf
  ├── /etc/mysql/debian.cnf
  ├── /etc/mysql/debian-start
  ├── /etc/mysql/mariadb.conf.d
  └── /etc/mysql/my.cnf

It all starts with with /etc/mysql/my.cnf, which ends as follows:

#
# * 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/

That means every file in that directory is included. Files are read in alphabetical order, so the prefixes such as 50- are used to specify order.

The benefit of this system, which Ubuntu uses for many other configurations as well, is that updates to the packages (and therefore default configurations) can be installed without conflicting with your changes and/or additions. It's also helps to remember what changes you actually made to these files–because you don't make any changes, you only create new files.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.