原來爲:http://yueyuanyuan.blog.51cto.com/1342062/378529
取消自動啓動
linux:/etc/init.d">root@sean-linux:/etc/init.d# service mysql stop
* Stopping MySQL database server mysqld [ OK ]
root@sean-linux:/etc/init.d# update-rc.d -f mysql remove
Removing any system startup links for /etc/init.d/mysql ...
/etc/rc0.d/K21mysql
/etc/rc1.d/K21mysql
/etc/rc2.d/S19mysql
/etc/rc3.d/S19mysql
/etc/rc4.d/S19mysql
/etc/rc5.d/S19mysql
/etc/rc6.d/K21mysql
手動啓動
root@sean-linux:/etc/init.d# service mysql start
* Starting MySQL database server mysqld [ OK ]
* Checking for corrupt, not cleanly closed and upgrade needing tables.
手動停止
root@sean-linux:/etc/init.d# service mysql stop
* Stopping MySQL database server mysqld [ OK ]
添加自動啓動
root@sean-linux:/etc/init.d# update-rc.d -f mysql defaults
Adding system startup for /etc/init.d/mysql ...
/etc/rc0.d/K20mysql -> ../init.d/mysql
/etc/rc1.d/K20mysql -> ../init.d/mysql
/etc/rc6.d/K20mysql -> ../init.d/mysql
/etc/rc2.d/S20mysql -> ../init.d/mysql
/etc/rc3.d/S20mysql -> ../init.d/mysql
/etc/rc4.d/S20mysql -> ../init.d/mysql
/etc/rc5.d/S20mysql -> ../init.d/mysql
root@sean-linux:/etc/init.d#
----------------------------------------------------------------------------
補充
Ubuntu 取消 Apache及MySQL等自啓動
1. 裝個 sysv-conf-rc
2. sudo update-rc.d -f mysql remove 刪除mysql隨機器啓動的服務
sudo update-rc.d -f apache2 remove 刪除apache2隨機器啓動的服務
3. 查看/etc/rc2.d/裏面的apache和mysql啓動腳本,通常都是兩個阿拉伯數字後再接一個英文字母,再加腳本名稱。英文字母是S的都是會自動啓動的,K則相反。所以只要找到apache和mysql的啓動腳本,把S改成K就可以了。