Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
    
possible duplicate of What's the recommend way to enable / disable services? –  Lekensteyn Feb 27 '12 at 20:11
add comment

1 Answer 1

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]
share|improve this answer
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. –  Florian Diesch Apr 13 '11 at 17:19
    
Great! Thanks for the solution –  Fran Diéguez Apr 13 '11 at 18:31
    
Great answer and nice question! Thanks, it is solved my problem. –  B. Roland Apr 13 '11 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 '12 at 23:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.