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
;. 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:
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
The lines appearing after a section marker support the named section
until the end of the file is reached or another group is encountered.
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 ...