File Content
All the configuration files share the same format. Example 4-1 is a sample configuration file. Much of it should be fairly straightforward, but we will take a moment to dissect the file.
# Example mysql options file. # # These options go to all clients [client] password = my_password port = 3306 socket = /var/lib/mysql/mysql.sock # These options go to the mysqld server [mysqld] port = 3306 socket = /var/lib/mysql/mysql.sock skip-locking set-variable = max_allowed_packet=1M
The first three lines beginning with
#
are comments. The MySQL configuration
file format supports two kinds of
comments: #
and
;
. MySQL ignores any data appearing after a pound
sign or a semicolon until the end of the line on which it appears.
The next line indicates the start of a section:
[client]
This format is actually one you may be familiar
with if you have played with Samba or Windows INI configuration. A
MySQL configuration file contains sections with configuration options
that apply only to that section. MySQL configuration files contain
two sections: client
and
mysqld
.
The lines appearing after a section marker support the named section
until the end of the file is reached or another group is encountered.
This client
section contains three configuration
items for the client tools. The first specifies the default password:
password = my_password
This option is equivalent to using the command-line option --password=my_password . As a general ...
Get Managing & Using MySQL, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.