首页 > Ubuntu/Debian操作系统 > ubuntu mysql 自动启动

ubuntu mysql 自动启动

2015年10月18日

ubuntu mysql 自动启动

http://www.gagahappy.com/ubuntu-mysql-add-to-service/
编译安装mysql后,用chkconfig令命将其加入随机启动
shell> cp mysql.server /etc/init.d/mysql
shell> chmod +x /etc/init.d/mysql
shell> chkconfig –add mysql
出现下面的错误

insserv: warning: script ‘K20acpi-support’ missing LSB tags and overrides
insserv: warning: current start runlevel(s) (0 6) of script `umountfs’ overwrites defaults (empty).
insserv: warning: current start runlevel(s) (0 6) of script `sendsigs’ overwrites defaults (empty).
insserv: warning: script ‘rsyslog’ missing LSB tags and overrides
insserv: warning: script ‘dmesg’ missing LSB tags and overrides
insserv: warning: script ‘acpi-support’ missing LSB tags and overrides
insserv: warning: script ‘udevtrigger’ missing LSB tags and overrides
insserv: warning: current start runlevel(s) (0 6) of script `wpa-ifupdown’ overwrites defaults (empty).
insserv: warning: script ‘gdm’ missing LSB tags and overrides
insserv: warning: script ‘acpid’ missing LSB tags and overrides
insserv: warning: script ‘hal’ missing LSB tags and overrides
insserv: warning: script ‘udevmonitor’ missing LSB tags and overrides
insserv: warning: script ‘cron’ missing LSB tags and overrides
insserv: warning: script ‘sreadahead’ missing LSB tags and overrides
insserv: warning: script ‘anacron’ missing LSB tags and overrides
insserv: warning: script ‘httpd2′ missing LSB tags and overrides
insserv: warning: script ‘procps’ missing LSB tags and overrides
insserv: warning: script ‘hwclock’ missing LSB tags and overrides
insserv: warning: script ‘usplash’ missing LSB tags and overrides
insserv: warning: script ‘hwclock-save’ missing LSB tags and overrides
insserv: warning: script ‘dbus’ missing LSB tags and overrides
insserv: warning: script ‘apport’ missing LSB tags and overrides
insserv: warning: current start runlevel(s) (6) of script `reboot’ overwrites defaults (empty).
insserv: warning: current start runlevel(s) (0 6) of script `umountnfs.sh’ overwrites defaults (empty).
insserv: warning: script ‘ufw’ missing LSB tags and overrides
insserv: warning: current start runlevel(s) (0 6) of script `umountroot’ overwrites defaults (empty).
insserv: warning: script ‘avahi-daemon’ missing LSB tags and overrides
insserv: warning: script ‘network-manager’ missing LSB tags and overrides
insserv: warning: script ‘atd’ missing LSB tags and overrides
insserv: warning: script ‘module-init-tools’ missing LSB tags and overrides
insserv: warning: script ‘udev-finish’ missing LSB tags and overrides
insserv: warning: current start runlevel(s) (0) of script `halt’ overwrites defaults (empty).
insserv: warning: script ‘rsyslog-kmsg’ missing LSB tags and overrides
insserv: warning: script ‘udev’ missing LSB tags and overrides
insserv: warning: current start runlevel(s) (0 6) of script `networking’ overwrites defaults (empty).
insserv: There is a loop between service rsyslog and pulseaudio if stopped
insserv:? loop involving service pulseaudio at depth 3
insserv:? loop involving service rsyslog at depth 2
insserv:? loop involving service udev at depth 1
insserv: There is a loop between service rsyslog and pulseaudio if stopped
insserv:? loop involving service dbus at depth 2
insserv: exiting without changing boot order!
/sbin/insserv failed, exit code 1
mysql ????????????????? 0:off? 1:off? 2:off? 3:off? 4:off? 5:off? 6:off
很明显,加入自动启动失败。到网上查询无果,最终用ubuntu自带的update-rc.d解决(chkconfig为linux自带 ,在部分ubuntu版本中(如8.04)被移去)
shell>sudo update-rc.d mysql defaults
然后在用chkconfig –list mysql 查看
mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off
终于正常了。
疑问:在虚拟机中可以成功用chkconfig将mysql加入到随机启动中,不知道为什么在主机中不能实现,以前在主机上也可以成功将mysql加入随机启动的啊(现在用的是ubuntu9.10)

本文的评论功能被关闭了.