博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mysql命令:set sql_log_bin=on/off
阅读量:5789 次
发布时间:2019-06-18

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

对于数据库的操作,经常需要暂时停止对bin-log日志的写入,那就需要这个命令:set sql_log_bin=on/off

参考:dev.mysql.com/doc/refman/5.5/en/set-sql-log-bin.html

13.4.1.3 SET sql_log_bin Syntax

SET sql_log_bin = {0|1}

The  variable controls whether logging to the binary log is done. The default value is 1 (do logging). To change logging for the current session, change the session value of this variable. The session user must have the privilege to set this variable. Set this variable to 0 for a session to temporarily disable binary logging while making changes to the master which you do not want to replicate to the slave.

As of MySQL 5.5,  can be set as a global or session variable. Setting  globally is only detected when a new session is started. Any sessions previously running are not impacted when setting globally.

Warning

Incorrect use of  with a global scope means any changes made in an already running session are stillbeing recorded to the binary log and therefore replicated. Exercise extreme caution using  with a global scope as the above situation could cause unexpected results including replication failure.

Beginning with MySQL 5.5.5, it is no longer possible to set @@session.sql_log_bin within a transaction or subquery. (Bug #53437)

 

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

你可能感兴趣的文章
Scrum之 Sprint计划会议
查看>>
List<T> to DataTable
查看>>
[Java]Socket和ServerSocket学习笔记
查看>>
stupid soso spider
查看>>
svn命令在linux下的使用
查看>>
There is insufficient system memory to run this query 错误
查看>>
基于ARM-contexA9-Linux驱动开发:如何获取板子上独有的ID号
查看>>
我们奋斗着并将持续奋斗 ----暨清华D-Lab创新基地揭牌仪式
查看>>
MySQL主从同步相关-主从多久的延迟?
查看>>
一分钟了解阿里云产品:网络安全专家服务
查看>>
自定义View以及事件分发总结
查看>>
人生第一个过万 Star 的 GitHub 项目诞生
查看>>
Mac下配置多个SSH-Key (gitLab)
查看>>
Gradle之module间依赖版本同步
查看>>
一些kindle资源
查看>>
Node第一天
查看>>
页面搭建工具总结及扩展架构思考
查看>>
java springcloud版b2b2c社交电商spring cloud分布式微服务(十五)Springboot整合RabbitMQ...
查看>>
SpringCloud使用Prometheus监控(基于Eureka)
查看>>
10g手动创建数据库
查看>>