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:
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.