[Unit] Description=MySQL 5.6 database server After=syslog.target After=network.target [Service] Type=simple User=mysql Group=mysql # Execute pre and post scripts as root PermissionsStartOnly=true ExecStartPre=/usr/libexec/mysql-check-socket ExecStartPre=/usr/libexec/mysql-prepare-db-dir %n ExecStart=/usr/bin/mysqld_safe --basedir=/usr ExecStartPost=/usr/libexec/mysql-wait-ready $MAINPID ExecStartPost=/usr/libexec/mysql-check-upgrade # Give a reasonable amount of time for the server to start up/shut down TimeoutSec=300 # Place temp files in a secure directory, not /tmp PrivateTmp=true [Install] WantedBy=multi-user.target