主从:Error:The size of BLOB/TEXT data inserted in one transaction is greater than 10% of redo log size

秒速五厘米 2022-11-15 11:14 163阅读 0赞

问题描述:mysql主从复制报错:Last_SQL_Error: Error ‘The size of BLOB/TEXT data inserted in one transaction is greater than 10% of redo log size. Increase the redo log size using innodb_log_file_size.
意思就是:在一个事务中插入的BLOB/TEXT数据的大小大于重做日志大小的10%。使用innodb_log_file_size增加重做日志大小。
报错如下:
MySQL主从复制报错
解决步骤:
1、查看innodb_log_file_size值的大小

  1. mysql> SHOW VARIABLES LIKE '%innodb_log_file_size%';
  2. +----------------------+---------+
  3. | Variable_name | Value |
  4. +----------------------+---------+
  5. | innodb_log_file_size | 5242880 |
  6. +----------------------+---------+

值为:5242880/1024/1024=5M
2、停止主从

  1. mysql> stop slave;
  2. Query OK, 0 rows affected (0.01 sec)

3、修改innodb_log_file_size值的大小

  1. vim my.cnf
  2. #添加参数
  3. innodb_log_file_size=256M
  4. 说明:修改完重启从数据库,企图临时修改set innodb_log_file_size = 256 * 1024 * 1024;,会报错:ERROR 1238 (HY000): Variable 'innodb_log_file_size' is a read only variable,只读变量,所有只能修改配置文件重启数据库。

4、重起完数据库,开启主从

  1. SHOW VARIABLES LIKE '%innodb_log_file_size%';
  2. +----------------------+-----------+
  3. | Variable_name | Value |
  4. +----------------------+-----------+
  5. | innodb_log_file_size | 268435456 |
  6. +----------------------+-----------+
  7. 1 row in set (0.00 sec)
  8. mysql> start slave;
  9. Query OK, 0 rows affected, 1 warning (0.00 sec)

主从状态恢复
完美解决,MySQL主从恢复正常!

发表评论

表情:
评论列表 (有 0 条评论,163人围观)

还没有评论,来说两句吧...

相关阅读