# 在/usr/lib/systemd/system/路径下创建mysql.service ]#vim /usr/lib/systemd/system/mysql.service [Unit] Description=MySQL server After=syslog.target network.target [Service] User=mysql Group=mysql Type=forking TimeoutSec=0 #PermissionsStartOnly=true ExecStart=/usr/local/mysql/bin/mysqld --defaults-file=/etc/my.cnf --daemonize LimitNOFILE = 65535 Restart=on-failure RestartSec=3 RestartPreventExitStatus=1 PrivateTmp=false [Install] WantedBy=multi-user.target
标签:systemd,target,MySQL,CentOS7,systemctl,usr,mysql From: https://www.cnblogs.com/lovezhr/p/17607562.html