A guide on configuring and running multiple independent MariaDB instances on the same machine by isolating data directories, ports, and sockets.
It is possible to run multiple MariaDB Server processes on the same server, but there are certain things that need to be kept in mind. This page will go over some of those things.
If multiple MariaDB Server process are running on the same server, then at minimum, you will need to ensure that the different instances do not use the same datadir, port, and socket. The following example shows these options set in an option file:
The above values are the defaults. If you would like to run multiple MariaDB Server instances on the same server, then you will need to set unique values for each instance.
There may be additional options that also need to be changed for each instance. Take a look at the full list of options for .
To see the current values set for an instance, see for how to do so.
To list the default values, check the end of the output of this command:
There are several different methods to start or stop the MariaDB Server process. There are two primary categories that most of these methods fall into: starting the process with the help of a service manager, and starting the process manually. See for more information.
If you want to run different MariaDB versions on the same machine, using , or using Virtual Machines (VMs) are the recommended ways. A binary tarball uses least resources, Docker a bit more and a VM uses most resources.
and are the most common Linux service managers. is used in MacOS X. is a less common service manager.
RHEL/CentOS 7 and above, Debian 8 Jessie and above, and Ubuntu 15.04 and above use by default.
For information on how to start and stop multiple MariaDB Server processes on the same server with this service manager, see .
is the actual MariaDB Server binary. It can be started manually on its own.
If you want to force each instance to read only a single , then you can use the option:
is a wrapper that can be used to start the server process. The script has some built-in safeguards, such as automatically restarting the server process if it dies. See for more information.
If you want to force each instance to read only a single , then you can use the option:
is a wrapper that can be used to start the server process if you plan to run multiple server processes on the same host. See for more information.
In some cases, there may be easier ways to run multiple MariaDB Server instances on the same server, such as:
Starting multiple containers.
Using (no longer maintained).
This page is licensed: CC BY-SA / Gnu FDL
[client]
# TCP port to use to connect to mariadbd server
port=3306
# Socket to use to connect to mariadbd server
socket=/tmp/mysql.sock
[mariadb]
# TCP port to make available for clients
port=3306
# Socket to make available for clients
socket=/tmp/mysql.sock
# Where MariaDB should store all its data
datadir=/usr/local/mysql/datamariadbd --help --verbosemariadbd --defaults-file=/etc/my_instance1.cnfmariadbd-safe --defaults-file=/etc/my_instance1.cnf