Tuesday, September 11, 2012

mysql: replication by db and table

if you want to setup replication in mysql for specific db only...

you can setup your master as:
# master

[mysqld]
port=3306
socket=/var/lib/mysql/mysql.sock

local-infile=1
server-id=1
log-bin
binlog-do-db=test_db

and your slave as:
# slave

[client]
port=3306
socket=/var/lib/mysql/mysql.sock

[mysqld]
port=3306
socket=/var/lib/mysql/mysql.sock

server-id=2
replicate-do-db=test_db


for replication of a specific table, use:
replicate-do-db=test_db.table1

No comments:

Post a Comment

SSH : No matching host key type found. Their offer: ssh-rsa,ssh-dss

Got this while connecting to my mikrotik router via ssh   Unable to negotiate with <ip address> port <ssh port>: no matching hos...