MySQL在Ubuntu設置自啟動的一個故障解決
作者:chszs,轉載需注明。博客主頁:http://blog.csdn.net/chszs
在解決MySQL自啟動,執行命令:
# chkconfig --list The program 'chkconfig' is currently not installed. You can install it by typing: apt-get install chkconfig
root@i-DFAFA998:~# apt-get install chkconfig Reading package lists... Done ……
安裝後執行:
# chkconfig --list | grep mysql mysql 0:off 1:off 2:off 3:off 4:off 5:off 6:off
用chkconfig讓MySQL自啟動時,執行命令報錯:
# chkconfig -a mysql /sbin/insserv: No such file or directory mysql 0:off 1:off 2:off 3:off 4:off 5:off 6:off
# ln -s /usr/lib/insserv/insserv /sbin/insserv
# chkconfig mysql on The script you are attempting to invoke has been converted to an Upstart job, but lsb-header is not supported for Upstart jobs. insserv: warning: script 'mysql' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `mysql' ......
chkconfig命令是用於RedHat/Fedora發行版的,而對於像Ubuntu之類的Debian發行版,應該使用這個命令:
sudo update-rc.d mysql defaults
# chkconfig --list | grep mysql mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off
最後提醒一句,別忘了刪除之前建立的符號連接
# rm -f /sbin/insserv