作者:jAne | 来源:互联网 | 2023-07-24 19:28
在RHEL7中,使用systemctl启动mysql1,创建启动文件.servicevimusrlibsystemdsystemmysqld.service[Unit]Descri
在RHEL7中,使用systemctl 启动mysql
1,创建启动文件 .service
vim /usr/lib/systemd/system/mysqld.service
[Unit]
Description=MySQL Server
After=network.target
After=syslog.target
[Service]
User=mysql
Group=mysql
Type=forking
PermissiOnsStartOnly=true
ExecStart= /etc/init.d/mysqld start
ExecStop= /etc/init.d/mysqld stop
ExecReload= /etc/init.d/mysqld restart
LimitNOFILE = 5000
[Install]
WantedBy=multi-user.target
2,重新加载一下服务的配置文件
systemctl daemon-reload
3,开启mysql服务
systemctl start mysqld.service
4,关闭mysql服务
systemctl stop mysqld.service