1#
2# Simple MySQL systemd service file
3#
4# systemd supports lots of fancy features, look here (and linked docs) for a full list:
5#   http://www.freedesktop.org/software/systemd/man/systemd.exec.html
6#
7# Note: this file ( /usr/lib/systemd/system/mysqld.service )
8# will be overwritten on package upgrade, please copy the file to
9#
10#  /etc/systemd/system/mysqld.service
11#
12# to make needed changes.
13#
14# systemd-delta can be used to check differences between the two mysqld.service files.
15#
16
17[Unit]
18Description=MySQL Community Server
19After=network.target
20After=syslog.target
21
22[Install]
23WantedBy=multi-user.target
24Alias=mysql.service
25
26[Service]
27User=mysql
28Group=mysql
29
30# Execute pre and post scripts as root
31PermissionsStartOnly=true
32
33# Needed to create system tables etc.
34ExecStartPre=/usr/bin/mysql-systemd-start pre
35
36# Start main service
37ExecStart=/usr/bin/mysqld_safe --basedir=/usr
38
39# Don't signal startup success before a ping works
40ExecStartPost=/usr/bin/mysql-systemd-start post
41
42# Give up if ping don't get an answer
43TimeoutSec=600
44
45Restart=always
46PrivateTmp=false
47
48
49