Learning Mysql


Structure of the Options File | 373



Download 4.24 Mb.
View original pdf
Page341/366
Date04.08.2023
Size4.24 Mb.
#61806
1   ...   337   338   339   340   341   342   343   344   ...   366
Learning MySQL
Structure of the Options File | 373

datadir=/home/mysql/data tmpdir=/home/mysql/tmp pid_file=/home/mysql/logs/server1.pid
# log server messages to:
log=/home/mysql/logs/server1.main.log
# log errors to this log_error=/home/mysql/logs/server1.error.log
# log updates to this binary logfile log_bin=/home/mysql/logs/server1_updates.bin
[client]
socket=/home/mysql/server1.sock
[mysql]
database=mysql
[mysqldump]
all-databases result_file=/tmp/dump.sql
There are four groups here one for the server, one for all clients, one for the mysql program, and one for the mysqldump program. The latter two are both clients, but the options we want to list in the file aren’t common to all clients, so we list them separately.
If an option appears for two applicable groups (for example
[client]
and
[mysql]
), the more specific setting (here, for
[mysql]
) takes precedence.
Lines starting with the hash or pound symbol (
#
) are ignored this allows you to add comments to the configuration file to explain entries. Blank lines are also ignored.
Scope of Options
The directives in an options file can apply at different levels depending on where the options file is located:
System-wide
Settings apply for all MySQL programs on the system.
The default location fora system-wide options file is /etc/my.cnf for Linux or Mac
OS X systems. Under Linux and Mac OS X, the MySQL server and client programs automatically read in an options file at the default location.
For a Windows system, the possible configuration file paths are
dows_Directory>\my.ini, \my.cnf, C:\my.ini, and C:
\my.cnf. The is the directory Windows is installed in, typically C:\Windows. Under Windows, current versions of the MySQL server (version and above) don’t actually read in an options file by default, so you should

Download 4.24 Mb.

Share with your friends:
1   ...   337   338   339   340   341   342   343   344   ...   366




The database is protected by copyright ©ininet.org 2024
send message

    Main page