CentOS 7 starts using SYSTEMCTL Management Services
Service Script Directory/etc/systemd/system/mysql.service
The script is as follows:
#
# Simple MySQL systemd service file
#
# SYSTEMD supports lots of fancy features, look here (and linked docs) for a full list:
# http://www.freedesktop.org/software/systemd/man/systemd.exec.html
#
# note:this file (/usr/lib/systemd/system/mysql.service)
# 'll be overwritten in package upgrade, please copy the file to
#
#/etc/systemd/system/mysql.service
#
# to make needed changes.
#
# Systemd-delta can used to check differences between the Mysql.service files.
#
[Unit]
Description=mysql Community Server
After=network.target
After=syslog.target
[Install]
Wantedby=multi-user.target
Alias=mysql.service
[Service]
User=mysql
Group=mysql
# Execute pre and post scripts as root
Permissionsstartonly=true
# Needed to create system tables etc.
#ExecStartPre =/usr/bin/mysql-systemd-start Pre
# Start Main Service
Execstart=/application/mysql/bin/mysqld_safe
# Don ' t signal startup success before a ping works
#ExecStartPost =/usr/bin/mysql-systemd-start Post
# Give up if ping don ' t get a answer
timeoutsec=600
Restart=always
Privatetmp=false
---
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 is 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 is writable or the error log must is present and writable for the user Runnin G themysqldprocess.
If MySQL error log is set under/var/log
Here are the Percona MySQL settings
[email protected] system]# cat Mysqld.service
#
# SYSTEMD Service file for Percona Server
#
# # This service file was to start PS just with Mysqld_safe
#
[Unit]
Description=mysql Percona Server
After=network.target
After=syslog.target
[Install]
Wantedby=multi-user.target
Alias=mysql.service
[Service]
# Execute pre and post scripts as root
Permissionsstartonly=true
# Needed to create system tables etc.
EXECSTARTPRE=/USR/BIN/MYSQL-SYSTEMD Pre
# Start Main Service
Execstart=/usr/bin/mysqld_safe
# Don ' t signal startup success before a ping works
Execstartpost=/usr/bin/mysql-systemd Post
# Give up if ping don ' t get a answer
timeoutsec=600
Restart=always
Privatetmp=false
[Email protected] system]# PW
Centos7 Systemctl managing MySQL