日期:2015/6/28来源: IT猫扑网
取消自动启动
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就可以了。
相关文章
相关下载
网友评论