vim /usr/lib/systemd/system/mysqld.service
写入system配置:
[Unit]
Description=MySQL Server
Documentation=mysqld
##mysql参考手册
Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html
After=network.target
After=syslog.target
[Install]
WantedBy=multi-user.target
[Service]
User=mysql
Group=mysql
ExecStart=/data/mysql/bin/mysqld --defaults-file=/etc/my.cnf
LimitNOFILE = 5000
重读systemd:
systemctl daemon-reload
启动服务,查看启动状态,并设置开机自启:
systemctl start mysqld.service
systemctl status mysqld.service
systemctl enable mysqld.service
逆风的方向,更适合飞翔,我不怕千万人阻挡,只怕自己投降。