General
cancel
Showing results for 
Search instead for 
Did you mean: 

how can i set mysql to start on boot ?

akademik
Occasional Contributor

how can i set mysql to start on boot ?

how can i set mysql to start on boot ?
like the apache etc ?
10x in advance
3 REPLIES
James R. Ferguson
Acclaimed Contributor

Re: how can i set mysql to start on boot ?

Hi:

If you are looking for the guidelines and an understanding of how to write startup and shutdown scripts, see this excellent (relatively short) document:

http://docs.hp.com/hpux/onlinedocs/os/startup.pdf

...JRF...
Tim D Fulford
Honored Contributor

Re: how can i set mysql to start on boot ?

I'm sure JRF's doc is more complete but v.quickly

1/ cp /sbin/init.d/apache /sbin/init.d/mysql
(or even /sbin/init.d/template)

2/ edit mysql & insert relavent
* start ststement,
* stop statement
* Choose & insert a UNIQUE system variable such as AUTOSTART_MYSQL=1 (say, 1 to start & 0 not to)

3/ vi /etc/rc.config.d/mysql
add in the environment variables from 2

4/ ln -s /sbin/init.d/mysql /sbin/rc2.d/S999mysql

The system goes through all the S??? files in numeric order to start them so S999mysql will be the last & S000??? will be the first

5/ If you want to include a stop statement then make sure /sbin/init.d/mysql has a stop in the case statement.

ln -s /sbin/init.d/mysql /sbin/rc2.d/K999mysql

If you want to test your script without a reboot simply run (as root)

/sbin/init.d/mysql start ## to start
&
/sbin/init.d/mysql stop ## to stop

If either of these do not work then it will not work at boot/shutdown time.

Good Luck

Tim
-
Rainer von Bongartz
Honored Contributor

Re: how can i set mysql to start on boot ?

Here is a fully working startup/shutdown script mysql on hp-ux 11.

copy this to /sbin/init.d and make a symbolic link

ln -s /sbin/rc3.d/Sxyzmysql /sbin/init.d/mysql

He's a real UNIX Man, sitting in his UNIX LAN making all his UNIX plans for nobody ...