mariadbd-multi - Man Page

manage multiple MariaDB servers (mariadbd-multi is now a symlink to mariadbd-multi)

Synopsis

mariadbd-multi [options] {start|stop|report} [GNR[,GNR] ...]

Description

mariadbd-multi is designed to manage several mariadbd 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.

mariadbd-multi searches for groups named [mariadbdN] in my.cnf (or in the file named by the --config-file option). N can be any positive integer. This number is referred to in the following discussion as the option group number, or GNR. Group numbers distinguish option groups from one another and are used as arguments to mariadbd-multi 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 [mariadbd] group used for starting mariadbd. 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.

To invoke mariadbd-multi, use the following syntax:

shell> mariadbd-multi [options] {start|stop|report} [GNR[,GNR] ...]

start, stop, and report indicate which operation to perform. You can perform the designated operation for a single server or multiple servers, depending on the GNR list that follows the option name. If there is no list, mariadbd-multi performs the operation for all servers in the option file.

Each GNR 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 GNR for a group named [mariadbd17] is 17. To specify a range of numbers, separate the first and last numbers by a dash. The GNR value 10-13 represents groups [mariadbd10] through [mariadbd13]. 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 GNR list; anything after a whitespace character is ignored.

This command starts a single server using option group [mariadbd17]:

shell> mariadbd-multi start 17

This command stops several servers, using option groups [mariadbd8] and [mariadbd10] through [mariadbd13]:

shell> mariadbd-multi stop 8,10-13

For an example of how you might set up an option file, use this command:

shell> mariadbd-multi --example

mariadbd-multi searches for option files as follows:

Option files read are searched for [mariadbd-multi] and [mariadbdN] option groups. The [mariadbd-multi] group can be used for options to mariadbd-multi itself. [mariadbdN] groups can be used for options passed to specific mariadbd instances.

The [mariadbd] or [mariadbd_safe] groups can be used for common options read by all instances of mariadbd or mariadbd_safe. You can specify a --defaults-file=file_name option to use a different configuration file for that instance, in which case the [mariadbd] or [mariadbd_safe] groups from that file will be used for that instance.

mariadbd-multi supports the following options.

Some notes about mariadbd-multi:

The following example shows how you might set up an option file for use with mariadbd-multi. The order in which the mariadbd 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 [mariadbdN] 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
[mariadbd-multi]
mariadbd     = /usr/local/bin/mariadbd-safe
mariadb-admin = /usr/local/bin/mariadb-admin
user       = multi_admin
password   = multipass
[mariadbd2]
socket     = /tmp/mariadb.sock2
port       = 3307
pid-file   = /usr/local/mysql/var2/hostname.pid2
datadir    = /usr/local/mysql/var2
language   = /usr/local/share/mariadb/english
user       = john
[mariadbd3]
socket     = /tmp/mysql.sock3
port       = 3308
pid-file   = /usr/local/mysql/var3/hostname.pid3
datadir    = /usr/local/mysql/var3
language   = /usr/local/share/mariadb/swedish
user       = monty
[mariadbd4]
socket     = /tmp/mysql.sock4
port       = 3309
pid-file   = /usr/local/mysql/var4/hostname.pid4
datadir    = /usr/local/mysql/var4
language   = /usr/local/share/mariadb/estonia
user       = tonu
[mariadbd6]
socket     = /tmp/mysql.sock6
port       = 3311
pid-file   = /usr/local/mysql/var6/hostname.pid6
datadir    = /usr/local/mysql/var6
language   = /usr/local/share/mariadb/japanese
user       = jani

See Also

For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/

Author

MariaDB Foundation (http://www.mariadb.org/).

Info

5 March 2025 MariaDB 11.8 MariaDB Database System