MySQL sets a self-starting fault solution in Ubuntu, mysqlubuntu

Source: Internet
Author: User

MySQL sets a self-starting fault solution in Ubuntu, mysqlubuntu

A fault solution for Setting Automatic startup for MySQL in Ubuntu

Author: chszs, reprinted with note. Blog homepage: http://blog.csdn.net/chszs

When MySQL is self-started, run the following command:

# chkconfig --listThe 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@i-DFAFA998:~# apt-get install chkconfigReading package lists... Done……


Run the following command after installation:

# chkconfig --list | grep mysqlmysql                     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 directorymysql                     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/insserv /sbin/insserv

Run the command to continue reporting errors

# chkconfig mysql onThe script you are attempting to invoke has been converted to an Upstartjob, but lsb-header is not supported for Upstart jobs.insserv: warning: script 'mysql' missing LSB tags and overridesinsserv: 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 mysqlmysql                     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


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.