8

I have MySQL on my computer for development purposes, but most of the time I don't use it. How can I configure my Debian so it won't start MySQL at boot, but only when I tell it to ( using service mysql start).

I did the same thing to apache2 using,

 update-rc.d -f apache2 remove

But I couldn't find a way to do this with MySQL.

Chida
  • 2,491
  • 1
  • 17
  • 29
Niv
  • 183
  • 1
  • 3

3 Answers3

16

You want update-rc.d mysql disable. You don't want remove, As noted in the update-rc.d manpage:

A common system administration error is to delete the links with the thought that this will "disable" the service, i.e., that this will pre‐ vent the service from being started. However, if all links have been deleted then the next time the package is upgraded, the package's postinst script will run update-rc.d again and this will reinstall links at their factory default locations

stew
  • 9,388
  • 1
  • 30
  • 43
2

Since Debian 8 (Jessy) using systemd by default, so try this:

systemctl list-units | grep mysql    # check for mysql unit name
systemctl disable mysql.service      # or whatever you find at prev step
1
update-rc.d -f mysql remove

or:

update-rc.d mysql disable
quanta
  • 51,413
  • 19
  • 159
  • 217