Thursday, February 23, 2012

Installing Multiple Mysql on same Machine

It took me lot of time figuring out how to install multiple mysql instances on same machine.
So I thought of sharing Process for setting up multiple Mysql on same machine will be useful for somebody looking for such manual...

1. Install Mysql server on that machine
2. Create a folder called xyz anywhere.
3. Create 2-3 folders...say data1, data2 etc inside xyz folder...they will hold the data for respective tables of respective installation.
4. Create 3 files my1.ini, my2.ini, my3.ini inside xyz folder.
5. Find out my.ini of your original Mysql server installation. And copy the content into all 3 ini files.
6. Modify following configurations in all 3 ini files according to your convenience. Here is example..
# password = your_password
port = 3307
socket = "C:/xampp/mysql/mypipe1"
port= 3307
socket = "C:/xampp/mysql/mypipe1"
server-id = 1
innodb_data_home_dir = "C:/mysql1/data1"
innodb_log_group_home_dir = "C:/mysql1/data1"

Each ini file will contain respective unique entry for port, datadir, socket, server-id etc..
7. Copy mySqlInstallationFolder/mysql/data/mysql folder into all 3 folders data1, data2 and data3.
8. Go to comand prompt and run these commands
Mysqlpath\mysql\bin\mysqld --install mysqld1 --defaults-file=yourPath\xyz\my1.ini [ for Windows...u can find equivalent Linux command for installing a new service ]
Mysqlpath\mysql\bin\mysqld --install mysqld2 --defaults-file=yourPath\xyz\my2.ini
Mysqlpath\mysql\bin\mysqld --install mysqld3 --defaults-file=yourPath\xyz\my3.ini

9. Start your respective service ie mysqld1,mysqld2,mysqld3 [these are all different instances of mysql].
10. Login to individual mysql server using following command
mysql -u root -h localhost -P 3307 [change your port name]
mysql -u root -h localhost -P 3307 -p [ if you have password for root ]


  1. Thanks Mukesh, it works great !!

  2. which mysql version u r using?

    1. It is version independent. I suppose I might have tried for mysql 5.5 or 5.6.

  3. Did this on Windows under MySQL 5.7. For step 8 I had to enclose the path in quotes, as in: Mysqlpath\mysql\bin\mysqld --install mysqld1 --defaults-file="yourPath\xyz\my1.ini"

    For Step 10: mysql --port=3307 --host= --user=root --password

  4. If your echo won't connect to wifi Or having any problem to setup Alexa to Wifi then Don't Worry we are here to help you just follow the simple steps which is given on our website. We'll help you to connect Alexa to wifi, connect echo to wifi and amazon echo not connecting to wifi and other problems. For instant help, call us at our amazon echo help number +1-888-745-1666.
    Setup echo
    Setup Echo Dot

  5. Do not panic if your Echo Look Setup is not running working. We are always here to solve all the problems related to your echo spot like echo Look wifi settings,installation,troubleshooting.Now the solution is at your fingertips. Just pick your phone and call us at :+1-888-745-1666 if you want to Connect Echo Look To Wifi.