centos7.x设置mysql自启动

前端之家收集整理的这篇文章主要介绍了centos7.x设置mysql自启动前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

编译安装MysqL并成功初始化后

whereis MysqL
cd /usr/local/MysqL
cp support-files/my-default.cnf /etc/my.cnf

vi /etc/systemd/system/MysqLd.service
[Unit]
Description=MysqL Server
Documentation=man:MysqLd(8)
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=/usr/local/MysqL/bin/MysqLd --defaults-file=/etc/my.cnf
LimitNOFILE = 5000
#添加到开机启动
systemctl enable MysqLd.service
systemctl start MysqLd
systemctl stop MysqLd
systemctl status MysqLd

猜你在找的CentOS相关文章