Warning | 1292:Truncated incorrect binlog_cache_size value:

binlog_cache_size的大小必须为4096的倍数,不然会有一个warning, “Warning | 1292 | Truncated incorrect binlog_cache_size value: '33792'”,然后向下取最接近n个4096的值。

官方文档上关于binlog_cache_size的描述如下:
binlog_cache_size
Command-Line Format --binlog_cache_size=#
System Variable Name binlog_cache_size
Variable Scope Global
Dynamic Variable Yes
Permitted Values (32-bit platforms) Type integer
Default 32768
Min Value 4096
Max Value 4294967295
Permitted Values (64-bit platforms) Type integer
Default 32768
Min Value 4096
Max Value 18446744073709551615

The size of the cache to hold changes to the binary log during a transaction. A binary log cache is allocated for each client if the server supports any transactional storage engines and if the server has the binary log enabled (--log-bin option). If you often use large transactions, you can increase this cache size to get better performance. The Binlog_cache_use and Binlog_cache_disk_use status variables can be useful for tuning the size of this variable. See Section 6.4.4, “The Binary Log”.

binlog_cache_size sets the size for the transaction cache only; the size of the statement cache is governed by the binlog_stmt_cache_size system variable.


实验:

mysql> select 4096/1024
    -> ;
+-----------+
| 4096/1024 |
+-----------+
|    4.0000 |
+-----------+
1 row in set (0.00 sec)

mysql> set global binlog_cache_size=1024*4;
Query OK, 0 rows affected (0.00 sec)

mysql> set global binlog_cache_size=1024*8;
Query OK, 0 rows affected (0.00 sec)

mysql> set global binlog_cache_size=1024*4*2;
Query OK, 0 rows affected (0.00 sec)

mysql> set global binlog_cache_size=1024*4*3;
Query OK, 0 rows affected (0.00 sec)

mysql> set global binlog_cache_size=1024*5;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> show warnings;
+---------+------+-----------------------------------------------------+
| Level   | Code | Message                                             |
+---------+------+-----------------------------------------------------+
| Warning | 1292 | Truncated incorrect binlog_cache_size value: '5120' |
+---------+------+-----------------------------------------------------+
1 row in set (0.00 sec)

mysql> set global binlog_cache_size=1024*6;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> set global binlog_cache_size=1024*7;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> set global binlog_cache_size=1024*9;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> set global binlog_cache_size=1024*10;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> show variables like 'binlog_cache_size';
+-------------------+-------+
| Variable_name     | Value |
+-------------------+-------+
| binlog_cache_size | 8192  |
+-------------------+-------+
1 row in set (0.00 sec)

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26735168/viewspace-2112732/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/26735168/viewspace-2112732/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值