我已将主数据库名称设置为MDB&在Slave服务器中我设置为replicate-do-db = SDB< - 这不起作用?但是,当我将其设置为相同的DB名称时,它可以工作.是否有任何解决方案来设置1个主数据库与2个不同的从属但在同一服务器?
replicate-rewrite-db
选项:
--replicate-rewrite-db=from_name->to_name
Tells the slave to translate the default database (that is,the one
selected by USE) to to_name if it was from_name on the master. Only
statements involving tables are affected (not statements such as
CREATE DATABASE,DROP DATABASE,and ALTER DATABASE),and only if
from_name is the default database on the master. This does not work
for cross-database updates. To specify multiple rewrites,use this
option multiple times. The server uses the first one with a from_name
value that matches. The database name translation is done before the
–replicate-* rules are tested.
如果您只复制某些数据库,则需要指定replicate-do-db
.请注意,此参数是replicate-rewrite-db应用重命名操作后的数据库名称:
--replicate-do-db=db_name