2009-09-16 14:03:18 +02:00
'\" t
2009-05-25 11:59:47 +02:00
. \" Title: \fBmysqld_multi\fR
2009-09-16 14:03:18 +02:00
. \" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
. \" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
2010-04-28 15:06:11 +02:00
. \" Date: 04/06/2010
2009-05-25 11:59:47 +02:00
. \" Manual: MySQL Database System
. \" Source: MySQL 5.1
2009-09-16 14:03:18 +02:00
. \" Language: English
2009-05-25 11:59:47 +02:00
. \"
2010-04-28 15:06:11 +02:00
.TH "\FBMYSQLD_MULTI\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
2009-09-16 14:03:18 +02:00
. \" -----------------------------------------------------------------
. \" * set default formatting
. \" -----------------------------------------------------------------
2009-05-25 11:59:47 +02:00
. \" disable hyphenation
.nh
. \" disable justification (adjust text to left margin only)
.ad l
2009-09-16 14:03:18 +02:00
. \" -----------------------------------------------------------------
. \" * MAIN CONTENT STARTS HERE *
. \" -----------------------------------------------------------------
. \" mysqld_multi
. \" tools: mysqld_multi
. \" scripts
. \" multi mysqld
2009-05-25 11:59:47 +02:00
.SH "NAME"
mysqld_multi \- manage multiple MySQL servers
.SH "SYNOPSIS"
2009-09-16 14:03:18 +02:00
.HP \w '\fBmysqld_multi\ [\fR\fB\fIoptions\fR\fR\fB]\ {start|stop|report}\ [\fR\fB\fIGNR\fR\fR\fB[,\fR\fB\fIGNR\fR\fR\fB]\ \& .\&.\&.]\fR\ 'u
\fB mysqld_multi [\fR \fB \fI options\fR \fR \fB ] {start|stop|report} [\fR \fB \fI GNR\fR \fR \fB [,\fR \fB \fI GNR\fR \fR \fB ] \& .\& .\& .]\fR
2009-05-25 11:59:47 +02:00
.SH "DESCRIPTION"
.PP
\fB mysqld_multi\fR
is designed to manage several
\fB mysqld\fR
2009-09-16 14:03:18 +02:00
processes that listen for connections on different Unix socket files and TCP/IP ports\& . It can start or stop servers, or report their current status\& . The MySQL Instance Manager is an alternative means of managing multiple servers (see
\fB mysqlmanager\fR (8))\& .
2009-05-25 11:59:47 +02:00
.PP
\fB mysqld_multi\fR
searches for groups named
[mysqld\fI N\fR ]
in
2009-09-16 14:03:18 +02:00
my\& .cnf
2009-05-25 11:59:47 +02:00
(or in the file named by the
\fB \- \- config\- file\fR
2009-09-16 14:03:18 +02:00
option)\& .
2009-05-25 11:59:47 +02:00
\fI N\fR
2009-09-16 14:03:18 +02:00
can be any positive integer\& . This number is referred to in the following discussion as the option group number, or
\fI GNR\fR \& . Group numbers distinguish option groups from one another and are used as arguments to
2009-05-25 11:59:47 +02:00
\fB mysqld_multi\fR
2009-09-16 14:03:18 +02:00
to specify which servers you want to start, stop, or obtain a status report for\& . Options listed in these groups are the same that you would use in the
2009-05-25 11:59:47 +02:00
[mysqld]
group used for starting
2009-09-16 14:03:18 +02:00
\fB mysqld\fR \& . (See, for example,
2009-12-01 08:24:05 +01:00
Section\ \& 2.13.1.2, \(lq Starting and Stopping MySQL Automatically\(rq \& .) However, when using multiple servers, it is necessary that each one use its own value for options such as the Unix socket file and TCP/IP port number\& . For more information on which options must be unique per server in a multiple\- server environment, see
2009-09-16 14:03:18 +02:00
Section\ \& 5.6, \(lq Running Multiple MySQL Servers on the Same Machine\(rq \& .
2009-05-25 11:59:47 +02:00
.PP
To invoke
\fB mysqld_multi\fR , use the following syntax:
.sp
2009-09-16 14:03:18 +02:00
.if n \{ \
.RS 4
. \}
2009-05-25 11:59:47 +02:00
.nf
2009-09-16 14:03:18 +02:00
shell> \fB mysqld_multi [\fR \fB \fI options\fR \fR \fB ] {start|stop|report} [\fR \fB \fI GNR\fR \fR \fB [,\fR \fB \fI GNR\fR \fR \fB ] \& .\& .\& .]\fR
2009-05-25 11:59:47 +02:00
.fi
2009-09-16 14:03:18 +02:00
.if n \{ \
2009-05-25 11:59:47 +02:00
.RE
2009-09-16 14:03:18 +02:00
. \}
2009-05-25 11:59:47 +02:00
.PP
start,
stop, and
report
2009-09-16 14:03:18 +02:00
indicate which operation to perform\& . You can perform the designated operation for a single server or multiple servers, depending on the
2009-05-25 11:59:47 +02:00
\fI GNR\fR
2009-09-16 14:03:18 +02:00
list that follows the option name\& . If there is no list,
2009-05-25 11:59:47 +02:00
\fB mysqld_multi\fR
2009-09-16 14:03:18 +02:00
performs the operation for all servers in the option file\& .
2009-05-25 11:59:47 +02:00
.PP
Each
\fI GNR\fR
2009-09-16 14:03:18 +02:00
value represents an option group number or range of group numbers\& . The value should be the number at the end of the group name in the option file\& . For example, the
2009-05-25 11:59:47 +02:00
\fI GNR\fR
for a group named
[mysqld17]
is
2009-09-16 14:03:18 +02:00
17\& . To specify a range of numbers, separate the first and last numbers by a dash\& . The
2009-05-25 11:59:47 +02:00
\fI GNR\fR
value
10\- 13
represents groups
[mysqld10]
through
2009-09-16 14:03:18 +02:00
[mysqld13]\& . Multiple groups or group ranges can be specified on the command line, separated by commas\& . There must be no whitespace characters (spaces or tabs) in the
2009-05-25 11:59:47 +02:00
\fI GNR\fR
2009-09-16 14:03:18 +02:00
list; anything after a whitespace character is ignored\& .
2009-05-25 11:59:47 +02:00
.PP
This command starts a single server using option group
[mysqld17]:
.sp
2009-09-16 14:03:18 +02:00
.if n \{ \
.RS 4
. \}
2009-05-25 11:59:47 +02:00
.nf
shell> \fB mysqld_multi start 17\fR
.fi
2009-09-16 14:03:18 +02:00
.if n \{ \
2009-05-25 11:59:47 +02:00
.RE
2009-09-16 14:03:18 +02:00
. \}
2009-05-25 11:59:47 +02:00
.PP
This command stops several servers, using option groups
[mysqld8]
and
[mysqld10]
through
[mysqld13]:
.sp
2009-09-16 14:03:18 +02:00
.if n \{ \
.RS 4
. \}
2009-05-25 11:59:47 +02:00
.nf
shell> \fB mysqld_multi stop 8,10\- 13\fR
.fi
2009-09-16 14:03:18 +02:00
.if n \{ \
2009-05-25 11:59:47 +02:00
.RE
2009-09-16 14:03:18 +02:00
. \}
2009-05-25 11:59:47 +02:00
.PP
For an example of how you might set up an option file, use this command:
.sp
2009-09-16 14:03:18 +02:00
.if n \{ \
.RS 4
. \}
2009-05-25 11:59:47 +02:00
.nf
shell> \fB mysqld_multi \- \- example\fR
.fi
2009-09-16 14:03:18 +02:00
.if n \{ \
2009-05-25 11:59:47 +02:00
.RE
2009-09-16 14:03:18 +02:00
. \}
2009-05-25 11:59:47 +02:00
.PP
2009-09-16 14:03:18 +02:00
As of MySQL 5\& .1\& .18,
2009-05-25 11:59:47 +02:00
\fB mysqld_multi\fR
searches for option files as follows:
2009-09-16 14:03:18 +02:00
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
. \" mysqld_multi: no-defaults option
. \" no-defaults option: mysqld_multi
2009-05-25 11:59:47 +02:00
With
2009-09-16 14:03:18 +02:00
\fB \- \- no\- defaults\fR , no option files are read\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
. \" mysqld_multi: defaults-file option
. \" defaults-file option: mysqld_multi
2009-05-25 11:59:47 +02:00
With
2009-09-16 14:03:18 +02:00
\fB \- \- defaults\- file=\fR \fB \fI file_name\fR \fR , only the named file is read\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
. \" mysqld_multi: defaults-extra-file option
. \" defaults-extra-file option: mysqld_multi
2009-05-25 11:59:47 +02:00
Otherwise, option files in the standard list of locations are read, including any file named by the
\fB \- \- defaults\- extra\- file=\fR \fB \fI file_name\fR \fR
2009-09-16 14:03:18 +02:00
option, if one is given\& . (If the option is given multiple times, the last value is used\& .)
2009-05-25 11:59:47 +02:00
.RE
.PP
2009-09-16 14:03:18 +02:00
Before MySQL 5\& .1\& .18, the preceding options are not recognized\& . Files in the standard locations are read, and any file named by the
2009-05-25 11:59:47 +02:00
\fB \- \- config\- file=\fR \fB \fI file_name\fR \fR
2009-09-16 14:03:18 +02:00
option, if one is given\& . A file named by
2009-05-25 11:59:47 +02:00
\fB \- \- config\- file\fR
is read only for
[mysqld\fI N\fR ]
option groups, not the
[mysqld_multi]
2009-09-16 14:03:18 +02:00
group\& .
2009-05-25 11:59:47 +02:00
.PP
2009-12-01 08:24:05 +01:00
Option files read are searched for
[mysqld_multi]
and
[mysqld\fI N\fR ]
option groups\& . The
[mysqld_multi]
group can be used for options to
\fB mysqld_multi\fR
itself\& .
[mysqld\fI N\fR ]
groups can be used for options passed to specific
\fB mysqld\fR
instances\& .
.PP
As of MySQL 5\& .1\& .35, the
[mysqld]
or
[mysqld_safe]
groups can be used for common options read by all instances of
\fB mysqld\fR
or
\fB mysqld_safe\fR \& . You can specify a
\fB \- \- defaults\- file=\fR \fB \fI file_name\fR \fR
option to use a different configuration file for that instance, in which case the
[mysqld]
or
[mysqld_safe]
groups from that file will be used for that instance\& . Before MySQL 5\& .1\& .35, some versions of
\fB mysqld_multi\fR
pass the
\fB \- \- no\- defaults\fR
options to instances, so these techniques are inapplicable\& .
.PP
2009-05-25 11:59:47 +02:00
\fB mysqld_multi\fR
2010-04-28 15:06:11 +02:00
supports the following options\& .
2009-09-16 14:03:18 +02:00
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
. \" mysqld_multi: help option
. \" help option: mysqld_multi
2009-05-25 11:59:47 +02:00
\fB \- \- help\fR
.sp
2009-09-16 14:03:18 +02:00
Display a help message and exit\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
. \" mysqld_multi: config-file option
. \" config-file option: mysqld_multi
2009-05-25 11:59:47 +02:00
\fB \- \- config\- file=\fR \fB \fI file_name\fR \fR
.sp
2009-09-16 14:03:18 +02:00
As of MySQL 5\& .1\& .18, this option is deprecated\& . If given, it is treated the same way as
\fB \- \- defaults\- extra\- file\fR , described earlier\& .
2010-04-28 15:06:11 +02:00
\fB \- \- config\- file\fR
is removed in MySQL 5\& .5\& .
2009-05-25 11:59:47 +02:00
.sp
2009-09-16 14:03:18 +02:00
Before MySQL 5\& .1\& .18, this option specifies the name of an extra option file\& . It affects where
2009-05-25 11:59:47 +02:00
\fB mysqld_multi\fR
looks for
[mysqld\fI N\fR ]
2009-09-16 14:03:18 +02:00
option groups\& . Without this option, all options are read from the usual
my\& .cnf
file\& . The option does not affect where
2009-05-25 11:59:47 +02:00
\fB mysqld_multi\fR
reads its own options, which are always taken from the
[mysqld_multi]
group in the usual
2009-09-16 14:03:18 +02:00
my\& .cnf
file\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
. \" mysqld_multi: example option
. \" example option: mysqld_multi
2009-05-25 11:59:47 +02:00
\fB \- \- example\fR
.sp
2009-09-16 14:03:18 +02:00
Display a sample option file\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
. \" mysqld_multi: log option
. \" log option: mysqld_multi
2009-05-25 11:59:47 +02:00
\fB \- \- log=\fR \fB \fI file_name\fR \fR
.sp
2009-09-16 14:03:18 +02:00
Specify the name of the log file\& . If the file exists, log output is appended to it\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
. \" mysqld_multi: mysqladmin option
. \" mysqladmin option: mysqld_multi
2009-05-25 11:59:47 +02:00
\fB \- \- mysqladmin=\fR \fB \fI prog_name\fR \fR
.sp
The
\fB mysqladmin\fR
2009-09-16 14:03:18 +02:00
binary to be used to stop servers\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
. \" mysqld_multi: mysqld option
. \" mysqld option: mysqld_multi
2009-05-25 11:59:47 +02:00
\fB \- \- mysqld=\fR \fB \fI prog_name\fR \fR
.sp
The
\fB mysqld\fR
2009-09-16 14:03:18 +02:00
binary to be used\& . Note that you can specify
2009-05-25 11:59:47 +02:00
\fB mysqld_safe\fR
2009-09-16 14:03:18 +02:00
as the value for this option also\& . If you use
2009-05-25 11:59:47 +02:00
\fB mysqld_safe\fR
to start the server, you can include the
mysqld
or
ledir
options in the corresponding
[mysqld\fI N\fR ]
2009-09-16 14:03:18 +02:00
option group\& . These options indicate the name of the server that
2009-05-25 11:59:47 +02:00
\fB mysqld_safe\fR
2009-09-16 14:03:18 +02:00
should start and the path name of the directory where the server is located\& . (See the descriptions for these options in
\fB mysqld_safe\fR (1)\& .) Example:
2009-05-25 11:59:47 +02:00
.sp
2009-09-16 14:03:18 +02:00
.if n \{ \
.RS 4
. \}
2009-05-25 11:59:47 +02:00
.nf
[mysqld38]
mysqld = mysqld\- debug
ledir = /opt/local/mysql/libexec
.fi
2009-09-16 14:03:18 +02:00
.if n \{ \
.RE
. \}
2009-05-25 11:59:47 +02:00
.RE
2009-09-16 14:03:18 +02:00
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
. \" mysqld_multi: no-log option
. \" no-log option: mysqld_multi
2009-05-25 11:59:47 +02:00
\fB \- \- no\- log\fR
.sp
Print log information to
stdout
2009-09-16 14:03:18 +02:00
rather than to the log file\& . By default, output goes to the log file\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
. \" mysqld_multi: password option
. \" password option: mysqld_multi
2009-05-25 11:59:47 +02:00
\fB \- \- password=\fR \fB \fI password\fR \fR
.sp
The password of the MySQL account to use when invoking
2009-09-16 14:03:18 +02:00
\fB mysqladmin\fR \& . Note that the password value is not optional for this option, unlike for other MySQL programs\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
. \" mysqld_multi: silent option
. \" silent option: mysqld_multi
2009-05-25 11:59:47 +02:00
\fB \- \- silent\fR
.sp
2009-09-16 14:03:18 +02:00
Silent mode; disable warnings\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
. \" mysqld_multi: tcp-ip option
. \" tcp-ip option: mysqld_multi
2009-05-25 11:59:47 +02:00
\fB \- \- tcp\- ip\fR
.sp
2009-09-16 14:03:18 +02:00
Connect to each MySQL server via the TCP/IP port instead of the Unix socket file\& . (If a socket file is missing, the server might still be running, but accessible only via the TCP/IP port\& .) By default, connections are made using the Unix socket file\& . This option affects
2009-05-25 11:59:47 +02:00
stop
and
report
2009-09-16 14:03:18 +02:00
operations\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
. \" mysqld_multi: user option
. \" user option: mysqld_multi
2009-05-25 11:59:47 +02:00
\fB \- \- user=\fR \fB \fI user_name\fR \fR
.sp
The user name of the MySQL account to use when invoking
2009-09-16 14:03:18 +02:00
\fB mysqladmin\fR \& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
. \" mysqld_multi: verbose option
. \" verbose option: mysqld_multi
2009-05-25 11:59:47 +02:00
\fB \- \- verbose\fR
.sp
2009-09-16 14:03:18 +02:00
Be more verbose\& .
.RE
2009-05-25 11:59:47 +02:00
.sp
2009-09-16 14:03:18 +02:00
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
. \" mysqld_multi: version option
. \" version option: mysqld_multi
\fB \- \- version\fR
2009-05-25 11:59:47 +02:00
.sp
2009-09-16 14:03:18 +02:00
Display version information and exit\& .
2009-05-25 11:59:47 +02:00
.RE
.PP
Some notes about
\fB mysqld_multi\fR :
2009-09-16 14:03:18 +02:00
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2009-05-25 11:59:47 +02:00
\fB Most important\fR : Before using
\fB mysqld_multi\fR
be sure that you understand the meanings of the options that are passed to the
\fB mysqld\fR
servers and
\fI why\fR
you would want to have separate
\fB mysqld\fR
2009-09-16 14:03:18 +02:00
processes\& . Beware of the dangers of using multiple
2009-05-25 11:59:47 +02:00
\fB mysqld\fR
2009-09-16 14:03:18 +02:00
servers with the same data directory\& . Use separate data directories, unless you
2009-05-25 11:59:47 +02:00
\fI know\fR
2009-09-16 14:03:18 +02:00
what you are doing\& . Starting multiple servers with the same data directory does
2009-05-25 11:59:47 +02:00
\fI not\fR
2009-09-16 14:03:18 +02:00
give you extra performance in a threaded system\& . See
Section\ \& 5.6, \(lq Running Multiple MySQL Servers on the Same Machine\(rq \& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
.if n \{ \
2009-05-25 11:59:47 +02:00
.sp
2009-09-16 14:03:18 +02:00
. \}
.RS 4
2009-05-25 11:59:47 +02:00
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
2009-09-16 14:03:18 +02:00
.ps +1
2009-05-25 11:59:47 +02:00
\fB Important\fR
2009-09-16 14:03:18 +02:00
.ps -1
.br
2009-05-25 11:59:47 +02:00
Make sure that the data directory for each server is fully accessible to the Unix account that the specific
\fB mysqld\fR
2009-09-16 14:03:18 +02:00
process is started as\& .
2009-05-25 11:59:47 +02:00
\fI Do not\fR
use the Unix
\fI root\fR
account for this, unless you
\fI know\fR
2009-09-16 14:03:18 +02:00
what you are doing\& . See
2010-04-28 15:06:11 +02:00
Section\ \& 5.3.6, \(lq How to Run MySQL as a Normal User\(rq \& .
2009-09-16 14:03:18 +02:00
.sp .5v
.RE
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2009-05-25 11:59:47 +02:00
Make sure that the MySQL account used for stopping the
\fB mysqld\fR
servers (with the
\fB mysqladmin\fR
2009-09-16 14:03:18 +02:00
program) has the same user name and password for each server\& . Also, make sure that the account has the
2009-05-25 11:59:47 +02:00
SHUTDOWN
2009-09-16 14:03:18 +02:00
privilege\& . If the servers that you want to manage have different user names or passwords for the administrative accounts, you might want to create an account on each server that has the same user name and password\& . For example, you might set up a common
2009-05-25 11:59:47 +02:00
multi_admin
account by executing the following commands for each server:
.sp
2009-09-16 14:03:18 +02:00
.if n \{ \
.RS 4
. \}
2009-05-25 11:59:47 +02:00
.nf
2009-09-16 14:03:18 +02:00
shell> \fB mysql \- u root \- S /tmp/mysql\& .sock \- p\fR
2009-05-25 11:59:47 +02:00
Enter password:
2009-09-16 14:03:18 +02:00
mysql> \fB GRANT SHUTDOWN ON *\& .*\fR
\- > \fB TO \' multi_admin\' @\' localhost\' IDENTIFIED BY \' multipass\' ;\fR
2009-05-25 11:59:47 +02:00
.fi
2009-09-16 14:03:18 +02:00
.if n \{ \
2009-05-25 11:59:47 +02:00
.RE
2009-09-16 14:03:18 +02:00
. \}
.sp
2009-05-25 11:59:47 +02:00
See
2009-09-16 14:03:18 +02:00
Section\ \& 5.4, \(lq The MySQL Access Privilege System\(rq \& . You have to do this for each
2009-05-25 11:59:47 +02:00
\fB mysqld\fR
2009-09-16 14:03:18 +02:00
server\& . Change the connection parameters appropriately when connecting to each one\& . Note that the host name part of the account name must allow you to connect as
2009-05-25 11:59:47 +02:00
multi_admin
from the host where you want to run
2009-09-16 14:03:18 +02:00
\fB mysqld_multi\fR \& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2009-05-25 11:59:47 +02:00
The Unix socket file and the TCP/IP port number must be different for every
2009-09-16 14:03:18 +02:00
\fB mysqld\fR \& . (Alternatively, if the host has multiple network addresses, you can use
2009-05-25 11:59:47 +02:00
\fB \- \- bind\- address\fR
2009-09-16 14:03:18 +02:00
to cause different servers to listen to different interfaces\& .)
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2009-05-25 11:59:47 +02:00
The
\fB \- \- pid\- file\fR
option is very important if you are using
\fB mysqld_safe\fR
to start
\fB mysqld\fR
(for example,
\fB \- \- mysqld=mysqld_safe\fR ) Every
\fB mysqld\fR
2009-09-16 14:03:18 +02:00
should have its own process ID file\& . The advantage of using
2009-05-25 11:59:47 +02:00
\fB mysqld_safe\fR
instead of
\fB mysqld\fR
is that
\fB mysqld_safe\fR
monitors its
\fB mysqld\fR
process and restarts it if the process terminates due to a signal sent using
kill \- 9
2009-09-16 14:03:18 +02:00
or for other reasons, such as a segmentation fault\& . Please note that the
2009-05-25 11:59:47 +02:00
\fB mysqld_safe\fR
2009-09-16 14:03:18 +02:00
script might require that you start it from a certain place\& . This means that you might have to change location to a certain directory before running
\fB mysqld_multi\fR \& . If you have problems starting, please see the
2009-05-25 11:59:47 +02:00
\fB mysqld_safe\fR
2009-09-16 14:03:18 +02:00
script\& . Check especially the lines:
2009-05-25 11:59:47 +02:00
.sp
2009-09-16 14:03:18 +02:00
.if n \{ \
.RS 4
. \}
2009-05-25 11:59:47 +02:00
.nf
\- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \-
MY_PWD=`pwd`
# Check if we are starting this relative (for the binary release)
2009-09-16 14:03:18 +02:00
if test \- d $MY_PWD/data/mysql \- a \e
\- f \& ./share/mysql/english/errmsg\& .sys \- a \e
\- x \& ./bin/mysqld
2009-05-25 11:59:47 +02:00
\- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \-
.fi
2009-09-16 14:03:18 +02:00
.if n \{ \
2009-05-25 11:59:47 +02:00
.RE
2009-09-16 14:03:18 +02:00
. \}
.sp
The test performed by these lines should be successful, or you might encounter problems\& . See
\fB mysqld_safe\fR (1)\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2009-05-25 11:59:47 +02:00
You might want to use the
\fB \- \- user\fR
option for
\fB mysqld\fR , but to do this you need to run the
\fB mysqld_multi\fR
script as the Unix
root
2009-09-16 14:03:18 +02:00
user\& . Having the option in the option file doesn\' t matter; you just get a warning if you are not the superuser and the
2009-05-25 11:59:47 +02:00
\fB mysqld\fR
2009-09-16 14:03:18 +02:00
processes are started under your own Unix account\& .
2009-05-25 11:59:47 +02:00
.RE
.PP
The following example shows how you might set up an option file for use with
2009-09-16 14:03:18 +02:00
\fB mysqld_multi\fR \& . The order in which the
2009-05-25 11:59:47 +02:00
\fB mysqld\fR
2009-09-16 14:03:18 +02:00
programs are started or stopped depends on the order in which they appear in the option file\& . Group numbers need not form an unbroken sequence\& . The first and fifth
2009-05-25 11:59:47 +02:00
[mysqld\fI N\fR ]
groups were intentionally omitted from the example to illustrate that you can have
\(lq gaps\(rq
2009-09-16 14:03:18 +02:00
in the option file\& . This gives you more flexibility\& .
2009-05-25 11:59:47 +02:00
.sp
2009-09-16 14:03:18 +02:00
.if n \{ \
.RS 4
. \}
2009-05-25 11:59:47 +02:00
.nf
2009-09-16 14:03:18 +02:00
# This file should probably be in your home dir (~/\& .my\& .cnf)
# or /etc/my\& .cnf
# Version 2\& .1 by Jani Tolonen
2009-05-25 11:59:47 +02:00
[mysqld_multi]
mysqld = /usr/local/bin/mysqld_safe
mysqladmin = /usr/local/bin/mysqladmin
user = multi_admin
password = multipass
[mysqld2]
2009-09-16 14:03:18 +02:00
socket = /tmp/mysql\& .sock2
2009-05-25 11:59:47 +02:00
port = 3307
2009-09-16 14:03:18 +02:00
pid\- file = /usr/local/mysql/var2/hostname\& .pid2
2009-05-25 11:59:47 +02:00
datadir = /usr/local/mysql/var2
language = /usr/local/share/mysql/english
user = john
[mysqld3]
2009-09-16 14:03:18 +02:00
socket = /tmp/mysql\& .sock3
2009-05-25 11:59:47 +02:00
port = 3308
2009-09-16 14:03:18 +02:00
pid\- file = /usr/local/mysql/var3/hostname\& .pid3
2009-05-25 11:59:47 +02:00
datadir = /usr/local/mysql/var3
language = /usr/local/share/mysql/swedish
user = monty
[mysqld4]
2009-09-16 14:03:18 +02:00
socket = /tmp/mysql\& .sock4
2009-05-25 11:59:47 +02:00
port = 3309
2009-09-16 14:03:18 +02:00
pid\- file = /usr/local/mysql/var4/hostname\& .pid4
2009-05-25 11:59:47 +02:00
datadir = /usr/local/mysql/var4
language = /usr/local/share/mysql/estonia
user = tonu
[mysqld6]
2009-09-16 14:03:18 +02:00
socket = /tmp/mysql\& .sock6
2009-05-25 11:59:47 +02:00
port = 3311
2009-09-16 14:03:18 +02:00
pid\- file = /usr/local/mysql/var6/hostname\& .pid6
2009-05-25 11:59:47 +02:00
datadir = /usr/local/mysql/var6
language = /usr/local/share/mysql/japanese
user = jani
.fi
2009-09-16 14:03:18 +02:00
.if n \{ \
2009-05-25 11:59:47 +02:00
.RE
2009-09-16 14:03:18 +02:00
. \}
2009-05-25 11:59:47 +02:00
.PP
See
2009-09-16 14:03:18 +02:00
Section\ \& 4.2.3.3, \(lq Using Option Files\(rq \& .
2009-05-25 11:59:47 +02:00
.SH "COPYRIGHT"
2009-09-16 14:03:18 +02:00
.br
2009-05-25 11:59:47 +02:00
.PP
2010-04-28 15:06:11 +02:00
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
2009-05-25 11:59:47 +02:00
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
.PP
2009-09-16 14:03:18 +02:00
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
2009-05-25 11:59:47 +02:00
.SH "SEE ALSO"
For more information, please refer to the MySQL Reference Manual,
which may already be installed locally and which is also available
online at http://dev.mysql.com/doc/.
.SH AUTHOR
2009-09-16 14:03:18 +02:00
Sun Microsystems, Inc. (http://www.mysql.com/).