Monday, 28 February 2011

Installing MySQL on Solaris (Part 3 - Running the mysql Demon)

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:

datadir=/export/home/mysql_data

Then create links to the appropriate run level directories (rc02.d or rc03.d). To do this, change to the default run level directory

cd ../rc3.d

and link to the init.d/mysql script to both start:

ln -s /etc/init.d/mysql S100mysql

and stop

ln -s /etc/init.d/mysql K100mysql

the mysql daemon.

No comments: