1 |
[Unit] |
2 |
Description=MySQL database server |
3 |
After=syslog.target |
4 |
After=network.target |
5 |
|
6 |
[Service] |
7 |
Type=forking |
8 |
User=mysql |
9 |
Group=mysql |
10 |
|
11 |
ExecStartPre=/usr/sbin/mysqld-prepare-db-dir |
12 |
ExecStart=/usr/bin/mysqld_safe --nowatch |
13 |
ExecStartPost=/usr/sbin/mysqld-wait-ready $MAINPID |
14 |
|
15 |
# mysqld-prepare-db-dir needs root rights, this drops privileges only for ExecStart |
16 |
PermissionsStartOnly=true |
17 |
|
18 |
# Give a reasonable amount of time for the server to start up/shut down |
19 |
TimeoutSec=300 |
20 |
|
21 |
# We rely on systemd, not mysqld_safe, to restart mysqld if it dies |
22 |
Restart=always |
23 |
|
24 |
[Install] |
25 |
WantedBy=multi-user.target |