Running MySQL as a Demon
This small blog demonstrates the steps required to start-up MySQL as a demon at boot time. The first step is to copy the mysql file from the installation directory (/opt/mysql/mysql/bin)
to the /etc/init.d directory and ensure that it’s executable (chmod 755 mysql).
You may want to store your MySQL data files in a non-default directory. To set this up, any text editor, edit the mysql file and locate the line which states: "datadir=<something>". Change this line to point to your preferred data directory:
Then create links to the appropriate run level directories (rc02.d or rc03.d). To do this, change to the default run level directory
and link to the init.d/mysql script to both start:
ln -s /etc/init.d/mysql S100mysql
ln -s /etc/init.d/mysql K100mysql
the mysql daemon.