设为首页收藏本站

LUPA开源社区

 找回密码
 注册
文章 帖子 博客
LUPA开源社区 首页 业界资讯 技术文摘 查看内容

Ubuntu下禁止和启用MySQL的自启动

2012-8-14 16:08| 发布者: 红黑魂| 查看: 2979| 评论: 0|来自: 速途网

摘要: 取消自动启动  linux:/etc/init.d"root@sean-linux:/etc/init.d# service mysql stop  * Stopping MySQL database server mysqld   root@sean-linux:/etc/init.d# update-rc.d -f mysql remove  Removin ...
    取消自动启动
  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就可以了。

酷毙

雷人

鲜花

鸡蛋

漂亮
  • 快毕业了,没工作经验,
    找份工作好难啊?
    赶紧去人才芯片公司磨练吧!!

最新评论

关于LUPA|人才芯片工程|人才招聘|LUPA认证|LUPA教育|LUPA开源社区 ( 浙B2-20090187 浙公网安备 33010602006705号   

返回顶部