1.停止服务
sudo systemctl stop mysql
sudo systemctl status mysql
○ mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Mon 2022-08-15 08:51:33 UTC; 1min 2s ago
Process: 7943 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Process: 7951 ExecStart=/usr/sbin/mysqld (code=exited, status=0/SUCCESS)
Main PID: 7951 (code=exited, status=0/SUCCESS)
Status: "Server shutdown complete"
Aug 15 08:40:31 ip-10-1-13-97 systemd[1]: Starting MySQL Community Server...
Aug 15 08:40:32 ip-10-1-13-97 systemd[1]: Started MySQL Community Server.
Aug 15 08:51:33 ip-10-1-13-97 systemd[1]: Stopping MySQL Community Server...
Aug 15 08:51:33 ip-10-1-13-97 systemd[1]: mysql.service: Deactiv