0

Whenever I boot, when I type systemctl status mysql.service, I see MySQL is running. I want to manually activate MySQL whenever I need it. I forget to turn off every single time I don't need the service. How can I get the setup I want?

Zanna
  • 70,465

2 Answers2

1

systemctl disable mysql.service to disable service on boot.

Type systemctl start mysql.service when you need and systemctl stop mysql.service to stop.

Jeremy
  • 2,846
0

To stop MySQL from starting when the computer starts you disable it in two steps:

  1. First stop MySQL from running:

    sudo systemctl stop mysql.service
    
  2. Then see to it that it won't start when restarting the computer:

    sudo systemctl disable mysql.service
    
Serafim
  • 495