6

This website explains MySQL server installation in Ubuntu 18.04. Basically you issue the command sudo apt install mysql-server. The same website then explains that:

Once the installation is completed, the MySQL service will start automatically. To check whether the MySQL server is running, type: sudo systemctl status mysql

Does this imply that once I install mysql-server it will always be running in the background unless I explicitly kill the process upon each reboot?

I want to play around with mysql-server occasionally, but don't want it constantly running in the background.

Display name
  • 2,231

1 Answers1

8

Does this imply that once I install mysql-server it will always be running in the background

Yes.

unless I explicitly kill the process upon each reboot?

No, never ever ever kill mysql. Killing it can damage your database.

  • sudo service mysql stop will stop the current session
  • sudo systemctl disable mysql to prevent it starting on boot. That is done once and makes it disabled each boot. sudo service mysql start will start mysql when disabled.
Rinzwind
  • 299,756
  • Do I need to sudo systemctl disable mysql once at the command line to disable indefinitely? Or do I need to add this sudo systemctl disable mysql command to some startup script to run each time I boot Ubuntu? Thank you. – Display name Aug 19 '19 at 16:59
  • 1
    That is done once. – Rinzwind Aug 19 '19 at 17:00
  • and final question, when I sudo apt install mysql-workbench do I need to worry about following any similar process? Or does MySQL Workbench have nothing to do with running a server, hence I just click the x to close it like any other program (Blender, LibreOffice, etc.)? – Display name Aug 20 '19 at 13:37
  • 1
    "hence I just click the x to close it like any other program" yes. – Rinzwind Aug 20 '19 at 13:43