•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 set the bind_address  system variable to cause different servers to listen to different interfaces.) 

•The --pid-file  option is very important if you are using mysqld_safe  to start mysqld  (for example, --mysqld=mysqld_safe ) Every mysqld  should have its own process ID file. The advantage of using mysqld_safe  instead of mysqld  is that mysqld_safe  monitors its mysqld  process and restarts it if the process terminates due to a signal sent using kill -9  or for other reasons, such as a segmentation fault. 

•You might want to use the --user  option for mysqld , but to do this you need to run the mysqld_multi  script as the Unix superuser ( root ). Having the option in the option file doesn’t matter; you just get a warning if you are not the superuser and the mysqld  processes are started 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  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 [mysqld N ]  groups were intentionally omitted from the example to illustrate that you can have “gaps”  in the option file. This gives you more flexibility. 

# This is an example of a my.cnf file for mysqld_multi. # Usually this file is located in home dir ~/.my.cnf or /etc/my.cnf [mysqld_multi] mysqld = /usr/local/mysql/bin/mysqld_safe mysqladmin = /usr/local/mysql/bin/mysqladmin user = multi_admin password = my_password [mysqld2] socket = /tmp/mysql.sock2 port = 3307 pid-file = /usr/local/mysql/data2/hostname.pid2 datadir = /usr/local/mysql/data2 language = /usr/local/mysql/share/mysql/english user = unix_user1 [mysqld3] mysqld = /path/to/mysqld_safe ledir = /path/to/mysqld-binary/ mysqladmin = /path/to/mysqladmin socket = /tmp/mysql.sock3 port = 3308 pid-file = /usr/local/mysql/data3/hostname.pid3 datadir = /usr/local/mysql/data3 language = /usr/local/mysql/share/mysql/swedish user = unix_user2 [mysqld4] socket = /tmp/mysql.sock4 port = 3309 pid-file = /usr/local/mysql/data4/hostname.pid4 datadir = /usr/local/mysql/data4 language = /usr/local/mysql/share/mysql/estonia user = unix_user3 [mysqld6] socket = /tmp/mysql.sock6 port = 3311 pid-file = /usr/local/mysql/data6/hostname.pid6 datadir = /usr/local/mysql/data6 language = /usr/local/mysql/share/mysql/japanese 

