An example of setting MySQL auto-start fault in Ubuntu
Run the following command to solve MySQL self-startup in Ubuntu:
# Chkconfig -- list
The program 'chkconfig' is currently not installed. You can install it by typing:
Apt-get install chkconfig
If the chkconfig script is not installed, install it:
Root@www.bkjia.com :~ # Apt-get install chkconfig
Reading package lists... Done
......
Run the following command after installation:
# Chkconfig -- list | grep mysql
Mysql 0: off 1: off 2: off 3: off 4: off 5: off 6: off
It can be seen that MySQL is not a self-starting service.
When you use chkconfig to enable MySQL to start itself, the following error occurs when you run the command:
# 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
The solution provided on the Internet is:
# Ln-s/usr/lib/insserv/sbin/insserv
Run the command to continue reporting errors
# 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'
......
Continue to find the cause and find:
The chkconfig command is used for the RedHat/Fedora release. for Debian releases such as Ubuntu, use this command:
Sudo update-rc.d mysql defaults
Verify:
# Chkconfig -- list | grep mysql
Mysql 0: off 1: off 2: on 3: on 4: on 5: on 6: off
It's done!
Finally, Let's remind you not to forget to delete the previously established symbolic connection.
# Rm-f/sbin/insserv