MariaDB Configuration
MariaDB is configured using a configuration file.
Contents
Syntax
The configuration file should consist of lines like parameter = value. Within parameter names, _ and - are interchangeable.
Values should be quoted using double quotes (").
The following escape codes are recognized:
Escape Code |
Meaning |
\n |
New line |
\r |
Carriage return |
\t |
Tab |
\b |
Backspace |
\s |
Space |
\" |
Literal doubel quote |
\' |
Literal single quote |
\\ |
Literal backsalsh |
Lines starting with a # are comments.
Option groups are specified like [groupname]. The same group can be specified multiple times.
The !include directive can be used to insert a file. Also, the !includedir directive can be used to include all .cnf/.ini files in a given directory. (Those files are read in alphabetical order.)
Networking
By default, MariaDB listens on 0.0.0.0 (i.e. all interfaces) and port 3306. Consider restricting to the loopback address:
[mysqld] bind-address = 127.0.0.1
Alternatively, block networking entirely and restrict MariaDB to sockets:
[mysqld] skip-networking
Encoding
To fully support Unicode, consider using utf8mb4 instead of utf8.
[client] default-character-set = utf8mb4 [mysqld] collation_server = utf8mb4_unicode_ci character_set_server = utf8mb4 [mysql] default-character-set = utf8mb4
Some distributions (such as Arch) have this as default.