Enabling and Disabling Starting MySQL Server at Boot
You can use the chkconfig script to verify whether MySQL has been configured to start when Linux is booted:
# chkconfig --list mysql mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off
The numbers 0 through 6 represents the run-levels and on/off signifies whether the service will be automatically started at that run-level. You can configure whether to start MySQL at a specific run level only using the chkconfig command.
To configure MySQL to automatically start when Linux is booted (by default runlevels 2, 3, 4, and 5 are used with chkconfig if not specified)
# chkconfig mysql on
To configure MySQL to not automatically start when Linux is booted (by default runlevels 2, 3, 4, and 5 are used with chkconfig if not specified)
# chkconfig mysql off
How to Start, Stop, and Check the Status of MySQL Using the Service Script?
The service script also provides means to check the current status of the MySQL process:
# service mysql start
# service mysql stop
Check the status of MySQL:
# service mysql status mysql (pid 19579) is running...
Additional commands are:
1. restart: the same as stop followed by start.
2. reload: issues a kill -HUP to the mysqld process.
3. force-reload: this is a synonyme for reload.