MySQL复制:如果我未指定任何数据库,log_bin会记录所有内容吗? [英] MySQL replication: if I don't specify any databases, will log_bin log EVERYTHING?

查看:84
本文介绍了MySQL复制:如果我未指定任何数据库,log_bin会记录所有内容吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为运行一堆数据库(每个客户端一个)的服务器设置复制,并计划一直在my.cnf上添加更多副本,而不是:

I'm setting up replication for a server which runs a bunch of databases (one per client) and plan on adding more all the time, on my.cnf, Instead of having:

binlog-do-db  = databasename 1
binlog-do-db  = databasename 2
binlog-do-db  = databasename 3
...
binlog-do-db  = databasename n

我可以只拥有

binlog-ignore-db  = mysql
binlog-ignore-db  = informationschema

(并且未指定要记录的数据库)并假定其他所有内容都已记录?

(and no database to log specified) and assume that everything else is logged?

实际上,如果我删除所有的binlog-do-db条目,则它似乎记录了所有内容(如您在移动数据库时看到的二进制日志文件更改位置),但是在从属服务器上,什么都没捡到! (也许,使用replicate-do-db是这种情况?这会扼杀这个想法;我想我无法让MySQL自动检测要复制的数据库).

actually if I remove all my binlog-do-db entries, it seemingly logs everything (as you see the binary log file change position when you move the database), but on the slave server, nothing gets picked up! (perhaps, this is the case to use replicate-do-db? this would kill the idea; i guess I cant have MySQL automagically detect which databases to replicate).

推荐答案

看起来正确:根据该参考文献:

有一些--binlog-ignore-db 规则.默认数据库是否匹配 任何--binlog-ignore-db规则?

There are some --binlog-ignore-db rules. Does the default database match any of the --binlog-ignore-db rules?

  • 是:不要编写该语句,然后退出.
  • 否:编写查询并退出.

由于您只有忽略命令,因此只要默认(活动)数据库与被忽略的数据库之一都不匹配,所有查询都将写入日志.

Since you only have ignore commands, all queries will be written to the log as long as the default (active) database doesn't match one of the ignored databases.

这篇关于MySQL复制:如果我未指定任何数据库,log_bin会记录所有内容吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆