4

In my laptop I have installed a LAMP environment for developing PHP apps. I would like to prevent these services (Apache, Mysql,..) starting on boot.

For apache is pretty simple to avoid it: sudo update-rc.d -f apache2 remove

but for mysqld I couldn't find a way to do the same.

I have googled it for a couple of days trying to get a solution for this but I didn't found it.

Cheers.

1

1 Answer 1

8

Are you using mysql-server-5.1 from ubuntu repos?

In the file /etc/init/mysql.conf you will find some line like the following:

start on (net-device-up
          and local-filesystems
          and runlevel [2345])
stop on runlevel [016]

Moving the '2' from start to stop should do the trick:

start on (net-device-up
          and local-filesystems
          and runlevel [345])
stop on runlevel [0126]
3
  • 1
    In general you can just comment out the whole "start on" statement if you don't want a service to be started at boot time. Apr 13, 2011 at 17:19
  • Great answer and nice question! Thanks, it is solved my problem.
    – antivirtel
    Apr 13, 2011 at 19:35
  • 1
    Note that in Ubuntu 11.04 and later you can also do this without editting the file directly by adding /etc/init/mysql.override and adding the keyword 'manual'
    – SpamapS
    Feb 27, 2012 at 23:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .