[replication-master]
1) mysql >= 4.0.2
mysql> GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.*
TO 'rep'@'xxx.xxx.xxx.%' IDENTIFIED BY '암호';
*) notic
add more privileges : SUPER and RELOAD
but, mysql-4.0.2 is FILE privileges
2) mysql < 4.0.2
mysql> GRANT FILE ON *.*
TO 'rep'@'xxx.xxx.xxx.%' IDENTIFIED BY '암호';
----------------------
[mysqld]
skip-locking
skip-name-resolve
log
log-bin ## <-- require
server-id = 1 ## <-- require
binlog-do-db = board1
binlog-do-db = board2
Binlog-ignore-db = mysql
...
----------------------
[replication-slave]
----------------------
[mysqld]
skip-locking
skip-name-resolve
log
server-id = 2
master-host = master_ip_or_hostname
master-user = rep
master-password = 암호
master-port = 3306
#master-connect-retry = 60
replicate-do-db = board1
replicate-do-db = board2
replicate-ignore-db = mysql
...
----------------------
[slave 에서 replication 이 실시간으로 안 될 때]
slave> rm -f ${DB_DIR}/*.info ${DB_DIR}/*-bin*
Slave> rsync –va rsync://master/masterdb/ path/to/slavedb/
slave> safe_mysqld & |