Database Reference
In-Depth Information
The MariaDB configuration file
On Windows, the MariaDB configuration file is named my.ini by default and is
found in the data directory (see the Filesystem layout for Windows section to find
out the data directory's location). The file can also be named my.cnf just as it is on
Linux, and MariaDB will also look in the following additional locations for it:
C:\WINDOWS\my.ini
C:\WINDOWS\my.cnf
C:\my.ini
C:\my.cnf
On Linux, the MariaDB configuration file is always named my.cnf and is almost
always found at one of the following two locations:
/etc/my.cnf
/etc/mysql/my.cnf
MariaDB will look for the file at both locations, but if both files exist, the options
in the file MariaDB reads last will override the options it read in the first file. So to
avoid confusion, we should only have one or the other and if we discover we have
both for some reason, we should combine them into one file.
The configuration file is just a text file and we can edit it with our favorite text editor.
Even though the extensions may be different ( .ini or .cnf ) the contents of the files
are laid out the same. Apart from empty lines, which are ignored, there are four main
types of lines in a MariaDB configuration file. These are: comments, groups, options
with no values, and options with values.
Comments
Comment lines are lines that begin with # or ; . Comments are ignored by MariaDB.
They often contain useful information and are a great place to keep notes when we
make changes to the file. Comments can also start in the middle of the line. Just think
of anything from the initial comment character to the end of a line as a comment.
Here are some examples:
# Here is a comment
; This is also a comment
port = 3306 # Here's a comment about the port number
 
Search WWH ::




Custom Search