MySQL distributions on Unix include a script named mysql.server. It can be used on systems that use run directories to start and stop system services, such as Linux and Solaris.
On Linux systems, the server RPM distribution installs mysql.server in /etc/init.d automatically under the name mysql.
If you install MySQL on Linux using another distribution format, or on a System V-style system, you can install the script manually by copying it to the /etc/init.d directory with the name mysql. Make sure the script is executable. (Use chmod +x mysql.)
The commands to activate the script depend on the operating system. On Linux, you can use chkconfig:
shell> chkconfig --add mysql
For other systems, consult your operating system documentation to see how to install startup scripts.