1,使用service & systemctl 启动、关闭MySQL服务
service管理
service mysql start
service mysql stop
service mysql restart
systemctl 管理
systemctl start mysql
systemctl stop mysql
systemctl restart mysql
systemctl start mariadb
systemctl stop mariadb
systemctl restart mariadb
运行上面命令,其实是service命令去找/etc/init.d下的相关的mysql脚本去执行启动、关闭动作。
2,使用/etc/init.d/mysql启动、关闭MySQL服务,
[root@DB-Server bin]# /etc/init.d/mysql start
Starting MySQL....[ OK ]
[root@DB-Server bin]# /etc/init.d/mysql stop
Shutting down MySQL..[ OK ]
[root@DB-Server bin]#
参考文献:
https://www.cnblogs.com/linjiqin/p/3544472.html