Database Reference
In-Depth Information
One other thing worth noting is that option names are not case sensitive. We can also
choose to use dashes (
-
) or underscores (
_
) in the names. For example, the following
two options are the same:
•
max_allowed_packet = 1M
•
MAX-Allowed-Packet
= 1M
One exception to this is with options that have values (described in the Options
which require values section). If the value is a file or location on a case-sensitive
filesystem like those used on Linux, that value will be case sensitive. The option
name is not case sensitive, but the value is. For example, the first two of the following
three examples work the same but the third does not (and on Linux it will almost
assuredly not work):
socket = /var/run/mysqld/mysqld.sock
Socket = /var/run/mysqld/mysqld.sock
socket = /VAR/run/mysqld/mysqld.sock
To keep our
my.cnf
file readable it is best to keep option names lowercase, even
though MariaDB will accept upper or mixed case. It is advised to keep options in
lowercase, unless they need to be otherwise.
Options which require values
As mentioned in the previous section, some configuration options require a value of
some sort to be set. For example, the default
[client]
section in the Ubuntu version
of the MariaDB
my.cnf
file contains the following two options:
port = 3306
socket = /var/run/mysqld/mysqld.sock
Setting options such as port or socket, or any other setting which requires a value,
without giving a value, will cause an error and MariaDB may refuse to start.
There is also a special line at the end of Linux
my.cnf
files. It begins with an
exclamation point (
!
) and its purpose is to include the special
conf.d
or
my.cnf.d
directories. Don't change or remove this line!
Downloading the example code
You can download the example code iles for all Packt topics you
have purchased from your account at
http://www.packtpub.
com
. If you purchased this topic elsewhere, you can visit
http://
www.packtpub.com
and register to have the files e-mailed directly
to you.