Two Mysql Instances¶
- install mysql
- copy the mysql data directory to say mysql1
So you have /var/db/mysql and /var/db/mysql1
-
Open the first mysql /var/db/mysql/my.cnf
Change
port = <The port you want the first mysql to listen to>
bind-address = <The ip you want the first mysql to bind to>
-
start the first mysql server
-
Open the second mysql /var/db/mysql1/my.cnf
Change
-
Write the startup command for the second mysql server
This works great for n number of mysql servers. Tested and working on one of my live servers.