MySQL Replication
Thanks
3 Replies
You can replicate multiple databases simply by having multiple "replicate-do-db" lines in the slave's my.cnf.
Of course you'll also need multiple "binlog-do-db" lines in the master's.
If you're using MySQL 5.0+, the basic things you'll probably need are:
–-----------------
my.cnf (MASTER):
[mysqld]
… your other settings …
log-bin=mysql-bin
my.cnf (SLAVES):
[mysqld]
Nothing special needed
–-----------------
On your Master:
Create a new user that has global replication permissions.
Load the initial data that you need (if any).
At the shell: mysqldump -uroot -p --all-databases --master-data > whatever.dump
Transfer whatever.dump to the slave Linode.
On your Slaves:
Login to MySQL and execute the commands: STOP SLAVE; CHANGE MASTER TO MASTERHOST='THEMASTERIPADDRESSORHOSTNAME', MASTERPORT=THEMASTERPORT(PROBABLY3306), MASTERUSER='THEREPLICATIONUSERYOUCREATED', MASTERPASSWORD='REPLICATIONUSER_PASSWORD'
At the shell: mysql -uroot -p < whatever.dump
Execute the MySQL command: START SLAVE;
That's from memory, I might have missed a step or two so let me know if it's not working.