Oracle 5.0 Reference Manual page 273

Table of Contents

Advertisement

mysqld_multi
• Make sure that the MySQL account used for stopping the
program) has the same user name and password for each server. Also, make sure that the account
has the
[578]
SHUTDOWN
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
account by executing the following commands for each server:
multi_admin
shell>
mysql -u root -S /tmp/mysql.sock -p
Enter password:
mysql>
GRANT SHUTDOWN ON *.*
->
TO 'multi_admin'@'localhost' IDENTIFIED BY 'multipass';
See
Section 6.2, "The MySQL Access Privilege
server. Change the connection parameters appropriately when connecting to each one. Note that
the host name part of the account name must permit you to connect as
where you want to run mysqld_multi.
• The Unix socket file and the TCP/IP port number must be different for every mysqld. (Alternatively,
if the host has multiple network addresses, you can use
servers to listen to different interfaces.)
• The
[248]
--pid-file
(for example,
--mysqld=mysqld_safe
file. The advantage of using
process and restarts it if the process terminates due to a signal sent using
mysqld
for other reasons, such as a segmentation fault. Please note that the
require that you start it from a certain place. This means that you might have to change location to
a certain directory before running mysqld_multi. If you have problems starting, please see the
script. Check especially the lines:
mysqld_safe
----------------------------------------------------------------
MY_PWD=`pwd`
# Check if we are starting this relative (for the binary release)
if test -d $MY_PWD/data/mysql -a -f ./share/mysql/english/errmsg.sys -a \
-x ./bin/mysqld
----------------------------------------------------------------
The test performed by these lines should be successful, or you might encounter problems. See
Section 4.3.2,
"mysqld_safe
• You might want to use the
script as the Unix superuser (root). Having the option in the option file doesn't
mysqld_multi
matter; you just get a warning if you are not the superuser and the
under your own Unix account.
The following example shows how you might set up an option file for use with mysqld_multi. The
order in which the
mysqld
in the option file. Group numbers need not form an unbroken sequence. The first and fifth
groups were intentionally omitted from the example to illustrate that you can have "gaps" in the option
file. This gives you more flexibility.
# This file should probably be in your home dir (~/.my.cnf)
# or /etc/my.cnf
# Version 2.1 by Jani Tolonen
[mysqld_multi]
mysqld
= /usr/local/bin/mysqld_safe
mysqladmin = /usr/local/bin/mysqladmin
user
= multi_admin
password
= multipass
[mysqld2]
socket
= /tmp/mysql.sock2
port
= 3307
pid-file
= /usr/local/mysql/var2/hostname.pid2
— Manage Multiple MySQL Servers
privilege. If the servers that you want to manage have different user
option is very important if you are using
[247]) Every
instead of
mysqld_safe
— MySQL Server Startup
[424]
option for mysqld, but to do this you need to run the
--user
programs are started or stopped depends on the order in which they appear
253
servers (with the
mysqld
System". You have to do this for each
--bind-address
mysqld_safe
should have its own process ID
mysqld
is that
mysqld
mysqld_safe
mysqld_safe
Script".
mysqld
mysqladmin
mysqld
from the host
multi_admin
[401]
to cause different
to start
mysqld
monitors its
or
kill -9
script might
processes are started
[mysqldN]

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents