博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mysql workbench 不能复制_来自MySQL Workbench的MySQL查询不会复制
阅读量:4964 次
发布时间:2019-06-12

本文共 1705 字,大约阅读时间需要 5 分钟。

bd96500e110b49cbb3cd949968f18be7.png

I am preparing to make some changes to a database I manage and was unsure that what I wanted to do would replicate properly so I ran some tests in a test environment and it turns out they will but only as long as I do not run the commands from the MySQL Workbench.

For example if have a database named db_test and a table in that database named test_a having only a single column id and I try to execute this from the workbench: INSERT INTO db_test.test_a (id) VALUES (114);

I get the expected row in the master database, but it never replicates to the slave.

When I perform a SHOW SLAVE STATUS - it shows everything is fine, and current. If I then use a different SQL client such as SequelPro and insert another row the same way (but obviously a different id) it shows in the master and replicates to the slave.

This has me baffled, and concerned as I want to understand what the difference is so I can avoid performing actions that never replicate.

解决方案

If you have set --replicate-do-db on the slave to filter replication for database db_test, replication is filtered based on the default database, so make sure that you issue USE db_test. Your client may be working differently in this manner, or you may be issuing different statements between clients.

Using --replicate-do-db set to db_test on the slave, this will replicate:

USE db_test;

INSERT INTO test_a (id) VALUES (114);

but this will not:

USE other_db;

INSERT INTO db_test.test_a (id) VALUES (114);

To get replication to work regardless of the current default database, use --replicate-wild-do-table to configure the database and table to replicate or don't filter at all.

Also, make sure that you are connected to the Master database server.

转载地址:http://lwhhp.baihongyu.com/

你可能感兴趣的文章
服务器一:分布式服务器结构
查看>>
迭代dict的value
查看>>
eclipse package,source folder,folder区别及相互转换
查看>>
Py 可能是最全面的 python 字符串拼接总结(带注释版)
查看>>
如何从亿量级中判断一个数是否存在?
查看>>
客户数据(类的调用)
查看>>
cookie session 和登录验证
查看>>
为mysql数据库建立索引
查看>>
语言-汉语-官话-中原官话-兖菏片:兖菏片
查看>>
HTML-参考手册: 画布
查看>>
杂项:MIS
查看>>
Node.js:全局对象
查看>>
6、python中的字符串
查看>>
String、StringBuffer与StringBuilder之间区别
查看>>
bash中常见环境变量env、set、export 、declare与bash漏洞原理
查看>>
Vue.js 子组件的异步加载及其生命周期控制
查看>>
数据库表结构导出sql语句
查看>>
C++库(Thrift)
查看>>
第十五周助教小结
查看>>
P2260 [清华集训2012]模积和
查看>>