To Install multiple mysql instances
1)The mysql config file (my.cnf) for different instance must be different. You can name the cnf files as you like ( eg mysql_3306.cnf , mysql_3307.cnf … ) 2) You need to have different data directories for every mysql instance. you can either start the mysql server using the different data directory or make an entry in configuration file.
MySQL Instances – /../mysql_instance1/bin , /../mysql_instance1/data
/../mysql_instance2/bin ,/../mysql_instance2/data 3) Each mysql instance must have a different port number.These port numbers can be changed in cnf.
#MySQL Instances1 Port=3306
#MySQL Instances2 Port=3307 4) The sockect files must be different . This can also be changed in the cnf. #MySQL Instances1 - my.cnf
socket=/tmp/mysql_3306.sock #MySQL Instances2 –my.cnf
socket=/tmp/mysql_3306.sock 5) While installing the grant tables with mysql_install_db you have to give the "datadir" option
6)While starting the server give the "defaults-file option" , "datadir" and "basedir". Or you can enter the path for basedir and datadir in cnf and start the server with the "defaults-file" option alone.