mysql同步复制的示例和配置选项

################# master ######

server-id = 1

log-bin=master-bin

binlog_format=mixed

relay-log=mysqld-relay-bin

binlog-do-db=Admin

binlog-do-db=Ctoshop

binlog-do-db=Item

binlog-do-db=Shopseting

binlog-do-db=Category

binlog-do-db=Transaction

replicate-ignore-db=mysql

################# slave ########

relay-log=slave-relay-bin

master-host=192.168.1.231

master-user=ctoshop

master-password=123456

master-connect-retry=10

replicate-do-db=Admin

replicate-do-db=Ctoshop

replicate-do-db=Item

replicate-do-db=Shopseting

replicate-do-db=Category

replicate-do-db=Transaction

server-id = 2

read-only = 1

#############master其他选项###############

replicate-ignore-db=db_name:不同步指定的库

replicate-ignore-table=db_name.tbl_name:不同步指定表

replicate-do-table=db_name.tbl_name:同步指定的表

########## slave其他选项 #######

skip-slave-start告诉从服务器当服务器启动时不启动从服务器线程。使用START SLAVE语句在以后启动线程。

该选项告诉从服务器SQL线程当语句返回任何选项值中所列的错误时继续复制。

slave-skip-errors=1062,1053

slave-skip-errors=all

0: 允许从属服务器独立地执行SQL命令(默认设置);

1: 从属服务器只能执行来自主控服务器的SQL命令。

read-only = 1

你可能感兴趣的:(mysql,数据库,示例,休闲,选项)