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.
Configuring Multiple MariaDB Server Processes
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
socket. The following example shows these options set in an option file:
[client] # TCP port to use to connect to mysqld server port=3306 # Socket to use to connect to mysqld 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/data
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 Checking Program Options for how to do so.
To list the default values, check the end of:
mysqld --help --verbose
Starting Multiple MariaDB Server Processes
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 Starting and Stopping MariaDB for more information.
RHEL/CentOS 7 and above, Debian 8 Jessie and above, and Ubuntu 15.04 and above use systemd by default.
For information on how to start and stop multiple MariaDB Server processes on the same server with this service manager, see systemd: Interacting with Multiple MariaDB Server Processes.
Starting the Server Process Manually
mysqld is the actual MariaDB Server binary. It can be started manually on its own.
mysqld_safe is a wrapper that can be used to start the
mysqld server process. The script has some built-in safeguards, such as automatically restarting the server process if it dies. See mysqld_safe for more information.
In some cases, there may be easier ways to run multiple MariaDB Server instances on the same server, such as::