LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Setup second MySQL server (https://www.linuxquestions.org/questions/linux-server-73/setup-second-mysql-server-928541/)

PlymWS 02-09-2012 03:51 PM

Setup second MySQL server
 
I'm trying to setup a second MySQL server on my CentOS 5.7 box. I've followed several Google results which all have you make a data directory and populate it from the command line. I've also made a my2.cnf file with the startup variables in.

The problem comes when I try and start the service. I copied the /etc/rc.d/init.d/mysqld file to mysqld2 and edited the values to point to the new data directory, pid file etc but if I run service mysqld2 start it starts the original server and not the new one.

I can start the second server from the command line but I would like to be able to start it as a service and have it automatically start on boot up.

Is there anything obvious I may have missed or any hints why the second init file doesn't pass the second cnf file when run ?

lithos 02-09-2012 04:17 PM

Hi,

maybe you need init script to start/run it:
- daemon init scripts
- linux init scripts
- register script with chkconfig

I haven't done anything like it, just remembered it, so I wrote you maybe it helps.

good luck

TenTenths 02-10-2012 05:26 AM

Check that youe /etc/rc.d/init.d/mysqld2 script has been edited to ensure that the second config file is being used.

There isn't a specific reference to my.cnf in the default file so you'll have to add the relevant section to the start) block yourself.


All times are GMT -5. The time now is 09:30 PM.