mysql参数sql_log_bin配置
mysql参数sql_log_bin配置
如果想在主库上执行一些操作,但不复制到slave库上,可以通过修改参数sql_log_bin来实现。比如说,这里模拟主从同步复制异常。
还有一种场景,就是导入或者删除大批量数据时,分别在主库和从库上执行,而不需要通过复制方式来达到一致。
-- 在从库上执行
mysql> set sql_log_bin=0;#设为0后,在Master数据库上执行的语句都不记录binlog
mysql> delete from t1 where id = 3; # 例如,该删除操作,将不会记录binlog中
mysql> set sql_log_bin=1;
-- 要慎重使用global修饰符(set global sql_log_bin=0),这样会导致所有在Master数据库上执行的语句都不记录到binlog,这肯定不是你想要的结果
-- 在主库上执行
mysql> delete from t1 where id = 3;
-- 在从库上执行
mysql> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 10.192.30.53
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000002
Read_Master_Log_Pos: 703173
Relay_Log_File: fudao_db_cluster_003-relay-bin.000002
Relay_Log_Pos: 2656
Relay_Master_Log_File: mysql-bin.000002
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table: test.%,information_schema.%
Last_Errno: 1032
Last_Error: Coordinator stopped because there were error(s) in the worker(s). The most recent failure being: Worker 1 failed executing transaction '46760eb0-bcb3-11e9-a352-24a9c4e7e87e:73' at master log mysql-bin.000002, end_log_pos 703142. See error log and/or performance_schema.replication_applier_status_by_worker table for more details about this failure or others, if any.
Skip_Counter: 0
Exec_Master_Log_Pos: 702860
Relay_Log_Space: 3192
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 1032
Last_SQL_Error: Coordinator stopped because there were error(s) in the worker(s). The most recent failure being: Worker 1 failed executing transaction '46760eb0-bcb3-11e9-a352-24a9c4e7e87e:73' at master log mysql-bin.000002, end_log_pos 703142. See error log and/or performance_schema.replication_applier_status_by_worker table for more details about this failure or others, if any.
Replicate_Ignore_Server_Ids:
Master_Server_Id: 3306
Master_UUID: 46760eb0-bcb3-11e9-a352-24a9c4e7e87e
Master_Info_File: mysql.slave_master_info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State:
Master_Retry_Count: 86400
Master_Bind:
Last_IO_Error_Timestamp:
Last_SQL_Error_Timestamp: 190813 11:22:24
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set: 46760eb0-bcb3-11e9-a352-24a9c4e7e87e:66-73
Executed_Gtid_Set: 46760eb0-bcb3-11e9-a352-24a9c4e7e87e:1-72
Auto_Position: 1
Replicate_Rewrite_DB:
Channel_Name:
Master_TLS_Version:
Master_public_key_path:
Get_master_public_key: 0
Network_Namespace:
1 row in set (0.00 sec) ERROR:
No query specified mysql>
mysql参数sql_log_bin配置的更多相关文章
- mysql参数sql_log_bin
如果想在主库上执行一些操作,但不复制到slave库上,可以通过修改参数sql_log_bin来实现. 比如想在主库上修改某个表的定义,但是在slave库上不做修改: master mysql> ...
- 【转】生产环境MySQL Server核心参数的配置
⑴ lower_case_table_names ● 推荐理由 GNU/Linux 平台,对数据库.表.存储过程等对象名称大小 ...
- MySQL慢日志查询全解析:从参数、配置到分析工具【转】
转自: MySQL慢日志查询全解析:从参数.配置到分析工具 - MySQL - DBAplus社群——围绕数据库.大数据.PaaS云,运维圈最专注围绕“数据”的学习交流和专业社群http://dbap ...
- Mysql 性能优化4 mysql参数配置
mysql 参数的介绍 大概450项参数,大多保持默认就可以了 错误的参数 崩溃,错误,运行缓慢. 参数最好在生产环境前配置好.最好不要在生产环境 中 直接配置,有可能不会立即生效,或者之前的数据和配 ...
- mysql中max_allowed_packet参数的配置方法(避免大数据写入或者更新失败)
修改方法 1.修改配置文件 可以编辑my.cnf来修改(windows下my.ini),在[mysqld]段或者mysql的server配置段进行修改. 代码如下: max_allowed_packe ...
- Java技术学习之影响MySQL性能的配置参数
本文将介绍MySQL参数的五大类设置,平时我们一般都很少碰它们,在进行MySQL性能调优和故障诊断时这些参数还是非常有用的. (一)连接连接通常来自Web服务器,下面列出了一些与连接有关的参数,以及该 ...
- PPTP + FreeRADIUS + MySQL 安装与配置
原文地址:http://www.zhukun.net/archives/5375 PPTP + FreeRADIUS + MySQL 安装与配置 2012/03/29Linux运维centos.Fre ...
- Mysql参数详解
1.配置参数 MySQL有两种途径途径了解其的配置参数,一个是MySQL交互模式下的命令SHOW VARIABLES,一个使用mysqladmin variables 查询. MySQL的配置参数分 ...
- NHibernate各种数据库连接参数文件配置方法说明
//NHibernate各种数据库连接参数文件配置方法说明 //配置文件Config/Hibernate.cfg.xml内容如下所示: <?xml version="1.0" ...
随机推荐
- 缓存融合(Cache Fusion)介绍
概念 简单地说,缓存融合就是把Oracle RAC数据库中所有数据库缓存作为一个共享的数据库缓存,并被RAC中的所有节点共享.它是实现RAC的基本技术. 缓存融合主要有如下四个功能: (1) 提供扩展 ...
- RTX和谐说明
1.下载安装原版RTX20152.打开“服务”,停止RTX开头的服务.3.替换C:\Program Files\Tencent\RTXServer\License目录下的License.ini文件:替 ...
- git 新建项目的一些操作
Command line instructions Git global setup git config --global user.name "Administrator" g ...
- tomcat报错解决方法
tomcat报错如 关闭被占用的进程 解决方法:cmd进入控制台,输入命令netstat -ano|findstr 8005 (什么端口号被占用就输入什么号),回车 发现是进程2044占用了这 ...
- token防爆破?
先尝试例如删除token 猜token的值等操作 不行就burp抓包 选择Pitchfork模式.选择要爆破的参数 线程设置为1显然只有获取上一个请求返回的taken值才能,做下一次请求 点击Ref ...
- 【神经网络与深度学习】leveldb的实现原理
郑重声明:本篇博客是自己学习 Leveldb 实现原理时参考了郎格科技系列博客整理的,原文地址:http://www.samecity.com/blog/Index.asp?SortID=12,只是为 ...
- discuz 设置
veikei_dz_com_20120821_gray_free 模板 论坛 瀑布流 需要在后台设置 论坛--板块管理--编辑对应板块--扩展设置--开启图片列表模式 FAQ 帮助页面 在后台管理 ...
- Python 爬取SeeBug poc
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2017-08-24 21:42:52 # @Author : EnderZhou (z ...
- [转帖]linux /proc目录下的文件为何无法用vi编辑保存
linux /proc目录下的文件为何无法用vi编辑保存 https://blog.51cto.com/xlogin/1216914 学习一下 之前看过书 这一点 没太仔细看.. xlogin关注8人 ...
- strtoul()引起的刷卡异常
)//10个字节 10进制数 { tempcard=strtoul((,);//将 cardnum[]=tempcard>>&0x00ff;//最高位 cardnum[]=temp ...