Home > Database > Mysql Tutorial > MySQL主从同步设置笔记

MySQL主从同步设置笔记

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:51:13
Original
1214 people have browsed it

主从同步的MySQL设置网上也笔记多。也没啥说得。主要记录一下我们公司的需求。MySQL跨库跨表的同步:replicate-wild-do-table =test%.%(两

主从同步的MySQL设置网上也笔记多。也没啥说得。主要记录一下我们公司的需求。

MySQL跨库跨表的同步:
replicate-wild-do-table =test%.%(两个%都很重要,我原来只写前面一个,,启动MySQL的时候会报错,同步以test打头的库名下的所有表)

多库的同步:
replicate-do-db = db1
replicate-do-db = src1

上述写法正确。

比较重要的命令。show slave status\G;
Relay_Master_Log_File: masterdb-bin.000009
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB: db1,src1
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table: test%.%
Replicate_Wild_Ignore_Table:

上面是同步的基本信息。

基本上同步出错的原因都是因为my.cnf的错误。 

linux

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template