- 论坛徽章:
- 0
|
sql_log_bin,是mysql session的一个变量,查看语句:
mysql> select @@session.sql_log_bin; +-----------------------+ | @@session.sql_log_bin | +-----------------------+ | 1 | +-----------------------+ 1 row in set (0.00 sec)
可以看出sql_log_bin的值是1|0, 当sql_log_bin的值为0的时候,本次连接mysql的session里面所输入的语句都不会被计入bin_log里面,也不会被丛库执行。
test:
master:
mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | +--------------------+ 2 rows in set (0.00 sec)
slave: mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | +--------------------+ 2 rows in set (0.00 sec)
在master上: mysql> set sql_log_bin=0; Query OK, 0 rows affected (0.00 sec)
mysql> select @@session.sql_log_bin; +-----------------------+ | @@session.sql_log_bin | +-----------------------+ | 0 | +-----------------------+ 1 row in set (0.00 sec)
mysql> create database test; Query OK, 1 row affected (0.00 sec)
+--------------------+ | Database | +--------------------+ | information_schema | | mysql | | test1 | +--------------------+ 4 rows in set (0.00 sec)
在丛库上: mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | +--------------------+ 3 rows in set (2.80 sec)
|
|