Thursday, October 22, 2009

Section 15.3. mysqld_multi







15.3. mysqld_multi

mysqld_multi

mysqld_multi [options] {start|stop|report} [server_id]

This option runs multiple MySQL servers on different socket
files and ports. To set up multiple servers, you must create a section
for each server in a configuration file (e.g., /etc/my.cnf). The naming scheme for
each section must be
[mysqldn],
where n is a different number for each
server. You must enter options separately for each server in its own
section, even when servers use the same options. At a minimum, each
server should use a different socket file or a different TCP/IP port.
You should also use different data directories for each server. The
directory should be accessible to the operating system user who
started the utility. It should not be the root
user, though, as this would be a security vulnerability. To see an
example of how a configuration file might be set up for multiple
servers, enter the following from the command line:

mysqld_multi --example


Once you have configured multiple servers, you can enter
something like the following from the command line to start a
server:

mysqld_multi start 3


This line would start server number 3, listed in the
configuration file as [mysqld3]. By entering
report for the first argument, you can obtain the
status on the server. For starting and stopping the server, this
script uses the mysqladmin utility. Here is an
alphabetical list of options specific to
mysqld_multi that you can enter from the command
line, along with a brief explanation of each:


--config-file=filename

This option specifies an alternative server configuration
file. As of version 5.1.18 of MySQL, though, this option has
been deprecated and is treated like
--defaults-extra-file.


--example

This option displays a sample configuration file.


--help

This option displays basic help information.


--log=filename

This option sets the name of the log file. The default is
/tmp/mysqld_multi.log.


--mysqladmin=filename

This option points to the executable file of the
mysqladmin utility to invoke.


--mysqld=filename

This option specifies the MySQL daemon to start, either
mysqld or mysqld_safe. If
this is mysqld, you should add the
--pid-file option of
mysqld so that each server will have a
separate process identifier file. If this option is set to
mysqld_safe, you probably should include the
options ledir and mysqld
as they relate to mysqld_safe. You would
include them in the options file under the server group for the
server started by mysqld_multi.


--no-log

This option instructs the utility not to save messages to
a log, but to send them to stdout
instead.


--password=password

This option provides the password for using
mysqladmin.


--silent

This option disables warning messages from the
utility.


--tcp-ip

This option sends this utility's commands to the server
using a TCP/IP socket instead of a Unix-domain socket.


--user=user

This option provides the username for using
mysqladmin. The same user must be used for
all servers and must have the SHUTDOWN
privilege on all of them.


--version

This option displays the version of the utility.








No comments: