Hello everyone,

I hope I have not reinvent the wheel with this but maybe it's worth sharing.
:)

I have Solaris8 and I needed multiple instances of MySQL (4.0.16), loading
at boot up, each one with unique configuration and running on different
ports.

Though in the manual (http://www.mysql.com/doc/en/Multiple_Unix_servers.html
& http://www.mysql.com/doc/en/mysqld_multi.html) ways for doing that are
mentioned, I really needed something straight forward and automatic. The
mysqld_multi script is useful but I could not make it work as a startup
script during boot up to start multiple instances (not even via another
script) . 

So what I did is:

1/ I copied multiple config files in the /etc dir (i.e. /etc/my.cnf,
/etc/my2.cnf etc) one for every server I need to start with its own
parameters, and edited the parameters.

2/ I copied the /usr/local/mysql/support-files/mysql.server under
/etc/init.d/ with different names, one for each server (i.e.
/etc/init.d/mysql.server, /etc/init.d/mysql.server2 etc.)

3/ I added this line:

print_defaults="/usr/local/mysql/bin/my_print_defaults
--config-file=/etc/<THE NAME OF THE .CNF FILE FOR THIS INSTANCE>"

This line must be added EXACTLY before this line:

        parse_arguments `$print_defaults $extra_args mysqld mysql_server
mysql.server`

4/ A bit after that line, there is:

              $bindir/mysqld_safe --datadir=$datadir --pid-file=$pid_file&

Just added --port=<THE PORT I WANT IT TO RUN ON> and it became:

              $bindir/mysqld_safe --datadir=$datadir --pid-file=$pid_file
--port=3307&

That's all

Then all I had to do is link the startup/shutdown scripts I just modified as
K and S under the /etc/rc?.d directories.

Thank's
Theophanis

PS: I could not figure out yet why I had to add --port= in step No4 to make
it work. If I do not do this, it starts on the default port 3306 and ends
immediately although I define it in the respective .cnf file. Any hints?

PS2: Has anyone successfully used mysqld_multi as boot up script?


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to