1.查看mysql服务的状态(以下三种写法等效)
sudo service mysql status
/etc/init.d/mysql status
sudo systemctl status mysql.service
2.开启mysql服务(以下三种写法等效)
sudo service mysql start
/etc/init.d/mysql start
sudo systemctl start mysql.service
3.关闭mysql服务
sudo service mysql stop
/etc/init.d/mysql stop
sudo systemctl stop mysql.service
4.重启mysql服务
sudo service mysql restart
/etc/init.d/mysql restart
sudo systemctl restart mysql.service
网友评论