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

Support for systemd includes these files: 

Note 

For the systemctl  command (and the alternative service  command), if the MySQL service name is not mysqld  then use the appropriate name. For example, use mysql  rather than mysqld  on Debian-based and SLES systems. 

• mysqld.service  (RPM platforms), mysql.service  (Debian platforms): systemd service unit configuration file, with details about the MySQL service. 

• mysqld@.service  (RPM platforms), mysql@.service  (Debian platforms): Like mysqld.service  or mysql.service , but used for managing multiple MySQL instances. 

• mysqld.tmpfiles.d : File containing information to support the tmpfiles  feature. This file is installed under the name mysql.conf . 

• mysqld_pre_systemd  (RPM platforms), mysql-system-start  (Debian platforms): Support script for the unit file. This script assists in creating the error log file only if the log location matches a pattern ( / var/log/mysql*.log  for RPM platforms, /var/log/mysql/*.log  for Debian platforms). In other cases, the error log directory must be writable or the error log must be present and writable for the user running the mysqld  process. 

## Configuring systemd for MySQL 

To add or change systemd options for MySQL, these methods are available: 

•Use a localized systemd configuration file. 

•Arrange for systemd to set environment variables for the MySQL server process. 

•Set the MYSQLD_OPTS  systemd variable. 

To use a localized systemd configuration file, create the /etc/systemd/system/mysqld.service.d directory if it does not exist. In that directory, create a file that contains a [Service]  section listing the desired settings. For example: 

[Service] LimitNOFILE= max_open_files Nice= nice_level LimitCore= core_file_limit Environment="LD_PRELOAD= /path/to/malloc/library " Environment="TZ= time_zone_setting " 

The discussion here uses override.conf  as the name of this file. Newer versions of systemd support the following command, which opens an editor and permits you to edit the file: 

systemctl edit mysqld # RPM platforms systemctl edit mysql # Debian platforms 

Whenever you create or change override.conf , reload the systemd configuration, then tell systemd to restart the MySQL service: 

systemctl daemon-reload systemctl restart mysqld # RPM platforms systemctl restart mysql # Debian platforms 

With systemd, the override.conf  configuration method must be used for certain parameters, rather than settings in a [mysqld] , [mysqld_safe] , or [safe_mysqld]  group in a MySQL option file: 

