Disable MySQL startup in Ubuntu 10.04

34

13

I want to prevent MySQL from starting in Ubuntu 10.04

I have used

update-rc.d -f mysql remove

and confirmed that there is no link to the /etc/inid.d/mysql script from any of the rc?.d directories.

I also ran sysv-rc-conf and it shows me that MySQL is NOT being called as part of the rc.d scripts.

It is still starting on boot. How do I disable it?

bryan

Posted 2010-05-06T03:38:33.207

Reputation: 7 848

mysqld is running under the mysql user account – bryan – 2010-05-07T04:33:45.410

Answers

37

Ubuntu 10.04 has abandoned SysV init script approach to booting the system.

This link explains - http://www.linuxplanet.com/linuxplanet/tutorials/7033/1/

To prevent mysql from starting on boot

  • 1 go to the /etc/init directory
  • 2. open the mysql.conf file
  • 3. comment out the "start on" line near the top of the file, the "start on" might be spread across two lines, so comment out both

If you want to manually start mysql, use the following command -

  service mysql start

bryan

Posted 2010-05-06T03:38:33.207

Reputation: 7 848

1

Link is 404. Use http://www.linuxplanet.com/linuxplanet/tutorials/7033/1/

– Kevin M – 2010-05-08T15:46:00.903

The link is fixed, and the answer is correct. – bryan – 2010-05-08T18:17:08.920

8

Instead of modifying the original .conf file, better use override files: (as root)# echo "manual" >> /etc/init/mysql.override

– nh2 – 2012-10-14T04:00:19.173

0

run the command as follows:

root@user:~# gedit /etc/init/mysql.conf 

then comment out the starting lines, I think there should be two, and you are all set!

Happy Linuxing to All!

Amos

Posted 2010-05-06T03:38:33.207

Reputation: 1

3/etc/init/ and /etc/init.d/ are NOT the same! I can't downvote this because I don't have the reputation, and I can't edit it because it's only a two-character change. – A B – 2012-03-16T00:38:45.180

@alberge - I made the edit. Waiting on peer review. – dhulihan – 2012-03-23T21:09:33.250

0

As @nh2 mentioned in his comment there's another — a way more clear/flexible way to disable(/enable) upstart's task: «…

With Upstart 1.3, you can make use of an "override file" and the manual stanza to achieve the same result in a simpler manner:

# echo "manual" >> /etc/init/myjob.override

…»

poige

Posted 2010-05-06T03:38:33.207

Reputation: 312