How to auto start MySQL server on Opensolaris after rebooting the machine?

Hi,

In Linux, I will do it by editing the /etc/rc.d/rc.local . However, I can't find a rc.local file in Opensolaris. So, how can I do it in Opensolaris? I am new to opensolaris, so please teach me step by step. Thanks in advance.

svcadm enable mysql

MySQL :: MySQL 5.1 Reference Manual :: 2.6.2 Installing MySQL on OpenSolaris using IPS

1 Like

Hi,

it results:
# svcadm enable mysql
svcadm: Pattern 'mysql' matches multiple instances:
svc:/application/database/mysql:version_51
svc:/application/database/mysql:version_50

and neither these two is the one I am using because I am not using the package manager to install it. I installed the tar.gz file.

Then why are you asking how to do it on OpenSolaris if you aren't using the OpenSolaris way to do it ?

As you use a tarball with no Solaris SMF integration, you can use the SVR4 legacy init.d scripts, which is, by the way, more common with linux distributions than the BSD way you are referring to with /etc/rc.d/rc.local.

Put the mysql init script in /etc/init.d/mysql and create (sym)links to it in /etc/rc0.d/K90mysql, /etc/rc1.d/K90mysql, /etc/rc2.d/K90mysql and /etc/rc3.d/S10mysql.

1 Like

Works!! Thanks very much