环境:
OS:Centos 7
DB:mysql 5730
设置开机自启动
在/etc/systemd/system目录下创建 mysql.service 文件
root下操作
vi /etc/systemd/system/mysql.service
[Unit]
Description=mysql
[Service]
User=mysql
LimitNOFILE=100000
LimitNPROC=100000
ExecStart=/opt/mysql5730/bin/mysqld_safe --defaults-file=/opt/mysql5730/conf/my.cnf
[Install]
WantedBy=multi-user.target
设置开机自启
systemctl enable mysql
启动后查看状态
systemctl status mysql