• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Getting MySQL to start automatically

Red Storm

Lifer
Topic pretty much says it all. I have MySQL installed on Solaris 10 (x86, 32-bit), and I'd like to know how to make MySQL autostart when the system boots. I'm quite new to UNIX in general and google has failed me here. Any help?

Edit: Okay, some more info. Looking at the mysql file under /etc/init.d it says:

"Usually this is put in /etc/init.d and linked to /etc/rc3.d/S99mysql and /etc/rc0.d/K01mysql. When this is done the mysql server will be started when the machine is started and shut down when the system goes down."


I checked both the rc0 and rc3 directories, and found no S99mysql or K01mysql files. I assume these are scripts. Do I need to create these scripts manually?
 
Okay, but the files were not there in the /etc/rcX.d directories. Do I need to create them myself, and if so, what should they contain?
 
Technically they contain nothing, they're just symlinks to the real script in /etc/init.d. If /etc/init.d/mysql start/stop successfully starts and stops MySQL you could just run 'ln -s ../init.d/mysql S99mysql' to create the start symlink and 'ln -s ../init.d/mysql K01mysql' to create the stop symlink in their respective directories.
 
It works, thanks! 🙂

On a somewhat related note, I'm also looking for a similar solution with Apache Tomcat. Admittedly I haven't really researched it yet, but if you know of a way to have it auto start when the server boots, that would be fantastic.
 
If Tomcat comes with a similar init script already written for you, you can do the same thing. If not, you'll have to find out if Solaris has a facility similar to rc.local in most Linux distributions and just put whatever startup commands you need in there.
 
Back
Top