There are numerous advantages to run multiple database instances on the save physical server. Here are some reasons that I would like to point out :
1. Utilize existing hardware properly
2. Long lead times to provide physical hardware
3. Reduce Licensing Hardware / OS costs
4. Smaller/manageable data center foot print
5. Reduced overhead
To run multiple instances using MysqL we need to have a couple of things separate from the initial install on MysqL like data directory,init script and config file. It is quite that simple and here is how we do it,I will subscript 2 for all the files/directories that I am going to create to indicate this new second instance:
1. Create a new data directory [/var/lib/MysqL2] and make MysqL user own it.
mkdir /var/lib/MysqL2
chown MysqL.MysqL /var/lib/MysqL2/
@H_403_40@
@H_403_40@
cp /etc/my.cnf /etc/my2.cnf
vi /etc/my2.cnfUpdate the lines as shown in the screenshot above [If you have a custom path,use it]:
datadir=/var/lib/MysqL2 port=33073. Create/copy existing MysqL init file to start/stop/reload etc on this new instance