content_image/757396.jpg
After modifying the systemd environment, restart the server to make the changes effective: 

systemctl restart mysqld # RPM platforms systemctl restart mysql # Debian platforms 

For platforms that use systemd, the data directory is initialized if empty at server startup. This might be a problem if the data directory is a remote mount that has temporarily disappeared: The mount point would appear to be an empty data directory, which then would be initialized as a new data directory. To suppress this automatic initialization behavior, specify the following line in the /etc/sysconfig/mysql  file (create the file if it does not exist): 

## Configuring Multiple MySQL Instances Using systemd 

NO_INIT=true 

This section describes how to configure systemd for multiple instances of MySQL. 

<img src='content_image/757396.jpg'>

## Note 

Because systemd has the capability of managing multiple MySQL instances on platforms for which systemd support is installed, mysqld_multi  and mysqld_multi.server  are unnecessary and are not installed. 

To use multiple-instance capability, modify the my.cnf  option file to include configuration of key options for each instance. These file locations are typical: 

• /etc/my.cnf  or /etc/mysql/my.cnf  (RPM platforms) 

• /etc/mysql/mysql.conf.d/mysqld.cnf  (Debian platforms) 

For example, to manage two instances named replica01  and replica02 , add something like this to the option file: 

RPM platforms: 

[mysqld@replica01] datadir=/var/lib/mysql-replica01 socket=/var/lib/mysql-replica01/mysql.sock port=3307 log-error=/var/log/mysqld-replica01.log [mysqld@replica02] datadir=/var/lib/mysql-replica02 socket=/var/lib/mysql-replica02/mysql.sock port=3308 log-error=/var/log/mysqld-replica02.log 

Debian platforms: 

[mysqld@replica01] datadir=/var/lib/mysql-replica01 socket=/var/lib/mysql-replica01/mysql.sock port=3307 log-error=/var/log/mysql/replica01.log [mysqld@replica02] datadir=/var/lib/mysql-replica02 socket=/var/lib/mysql-replica02/mysql.sock port=3308 log-error=/var/log/mysql/replica02.log 

The replica names shown here use @  as the delimiter because that is the only delimiter supported by systemd. 

