Debian - 在启动时阻止 MySQL 启动

Niv*_*Niv 8 mysql debian boot

我的计算机上有 MySQL 用于开发目的,但大部分时间我不使用它。我如何配置我的 Debian 以便它不会在启动时启动 MySQL,但只有当我告诉它(使用service mysql start)时。

我对 apache2 做了同样的事情,

 update-rc.d -f apache2 remove
Run Code Online (Sandbox Code Playgroud)

但是我找不到用 MySQL 做到这一点的方法。

ste*_*tew 16

你要update-rc.d mysql disable。您不想删除,如 update-rc.d 联机帮助页中所述:

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