The mysqld_multi command has been designed to manage several mysqld processes which listen for connections on different Unix socket files and TCP/IP ports. It can be used to start or stop servers, or report their current status.
It can be invoked using the below code −
shell> mysqld_multi [options] {start|stop|reload|report} [GNR[,GNR] ...]
The start, stop, reload (stop and restart), and report indicate which operation needs to be performed. The designated operation can be performed for a single server or multiple servers, and this depends on the GNR list that follows the option name. GNR is the group number.
Let us take an example −
The GNR for a group named [mysqld17] is 17. To specify the range of numbers, the first and last numbers need to be separated by a dash.
The GNR value 10-13 represents groups [mysqld10] through [mysqld13].
Multiple groups or group ranges can be specified on the command line, and they can be separated by commas.
There should be no whitespace characters or spaces or tabs in the GNR list.
Anything after a whitespace character is ignored.
The below command starts a single server using option group [mysqld17].
shell> mysqld_multi start 17
The below command stops several servers, with the help of option groups [mysqld8] and [mysqld10] through [mysqld13].
shell> mysqld_multi stop 8,10-13
To set up an option file, the below command can be used −
shell> mysqld_multi --example
Let us see some of the command line options can be used with it −
--example
It displays a sample option file.
--log=file_name
It specifies the name of the log file. If the file exists, then the log output is appended to it.
--mysqladmin=prog_name
It is the mysqladmin binary that needs to be used to stop servers.