Ubuntu self-booting Mysql three ways _mysql

Source: Internet
Author: User

1, Software Environment:

Ubuntu 14.04.1 LTS (gnu/linux 3.13.0-32-generic x86_64)
MySQL 5.6.27 x64

2. Method One

The easiest way to do this is to execute the command:

Copy Code code as follows:

# UPDATE-RC.D 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

Note: Remove the MySQL boot service executable command update-rc.d MySQL remove

3, Method two

The second method is to use the Sysv-rc-conf tool to execute the command:

Copy Code code as follows:

# Apt-get Install sysv-rc-conf
# sysv-rc-conf

A command-line-initiated service management interface is turned on:

Click with the mouse, you can also use the keyboard direction key positioning, with the space bar to choose, "X" means to open the service. Use CTRL + N to flip the next page, with Ctrl+p to turn over a page, with Q exit.

You can also use the command:

Copy Code code as follows:

# sysv-rc-conf--level 2345 MySQL off

Note: The operating level of services in the Ubuntu system

0 System shutdown Status
1 single user or system maintenance status
2~5 Multi-user status
6 reboot

4, Method three

The third method is to use the Chkconfig tool to execute the command:

Copy Code code as follows:

# Apt-get Install Chkconfig
# chkconfig MySQL--list
MySQL 0:off 1:off 2:off 3:off 4:off 5:off 6:off

If Mysqld is not in the list, then add it with the command:

Copy Code code as follows:

# chkconfig Add MySQL

We can see that mysqld was already in the list, so this step we skipped.

To use the command to set up boot:

Copy Code code as follows:

# chkconfig--add MySQL
# chkconfig MySQL--list
MySQL 0:off 1:off 2:on 3:on 4:on 5:on 6:off

Indicates that the MySQL boot has been set to complete.

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.