User Tools

Site Tools


two_mysql_instances

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

two_mysql_instances [2009/04/24 12:29] (current)
k2patel created
Line 1: Line 1:
 +====== 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
 +    <code text>
 +    port = <The port you want the first mysql to listen to>
 +    bind-address = <The ip you want the first mysql to bind to>
 +    </​code>​
 +
 +  - start the first mysql server
 +
 +  - Open the second mysql /​var/​db/​mysql1/​my.cnf
 +
 +    Change
 +<code text>
 +port = <The port you want the second mysql to listen to>
 +bind-address = <The ip you want the second mysql to bind to>
 +</​code>​
 +
 +  - Write the startup command for the second mysql server
 +<code bash>
 +/​usr/​local/​bin/​mysqld_safe --bind-address=<​The ip address you want to bind
 +the second mysql server to> --user=mysql --socket=/​tmp/​mysql1.sock
 +--datadir=/​var/​db/​mysql1 --pid-file=/​var/​run/​mysql1.pid &
 +</​code>​
 +
 +This works great for n number of mysql servers. Tested and working on one of
 +my live servers. ​
 +
 +
 +[[http://​dev.mysql.com/​doc/​refman/​5.1/​en/​multiple-servers.html | further reference]]
two_mysql_instances.txt ยท Last modified: 2009/04/24 12:29 by k2patel