当前所在位置:珠峰网资料 >> 计算机 >> 计算机等级考试 >> 正文
Ubuntu下禁止和启用MySQL的自启动
发布时间:2010/8/20 10:41:12 来源:城市学习网 编辑:ziteng
  取消自动启动
  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就可以了。
广告合作:400-664-0084 全国热线:400-664-0084
Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15066211号
珠峰网 版权所有 All Rights Reserved