zoukankan      html  css  js  c++  java
  • binlog_format日志错误

    客户磁盘空间不够用,发现mysql的err日志文件已每天大概600M-800M的速度增长,开头考虑作日志切割,打开发现,整个7.8G的文件里面百分之99的文件全部是如下所示的warning警告信息

    180531 9:21:01 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe Statement: insert into log_user_active_degree(corp_id,user_id,statistic_time,startTime,endTime,login_count) values(1001,'archive@globalegrow.com','2018-05-31 09:20:44','2018-05-31 08:00:00','2018-05-31 10:00:00','1') on duplicate key update login_count=login_count+1
    180531 9:21:01 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe Statement: insert into log_user_active_degree(corp_id,user_id,statistic_time,startTime,endTime,login_count) values(1001,'dongzhao@globalegrow.com','2018-05-31 09:20:44','2018-05-31 08:00:00','2018-05-31 10:00:00','1') on duplicate key update login_count=login_count+1
    180531 9:21:01 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe Statement: insert into log_user_active_degree(corp_id,user_id,statistic_time,startTime,endTime,login_count) values(1001,'diana_lee@globalegrow.com','2018-05-31 09:20:44','2018-05-31 08:00:00','2018-05-31 10:00:00','1') on duplicate key update login_count=login_count+1
    180531 9:21:02 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Statement: insert into rm_popmail_mid (userMailName,mail_addr,isAutoPop,status,days,createtime,appId,id,starttime) select userMailName,mail_addr,isAutoPop,9,if(flag=0, 0, if(flag=1, 7, 30)) as days,sysdate(),appId,id,sysdate() from rm_user_popmail a where appid=1 and isAutoPop=1 and lastrecvtime<='2018-05-31 09:11:17' and authenticated in (0,1) and not exists (select 'X' from rm_popmail_mid b where b.id = a.id)

    将binlog_fomat进行修改

    set session binlog_format='row';

    set global binlog_format=row;

    发现仍然不起作用,只能变相的去做改变了,要么修改存储过程,要么写个脚本凌晨清空,

  • 相关阅读:
    工作感悟(一)
    laydate组件选择时间段的判断
    Win10下免安装版JDK8环境变量配置
    IDEA中lombok插件的安装
    解决加载WEB页面时,由于JS文件引用过多影响页面打开速度的问题
    Windows环境下的MYSQL5.7配置文件定位
    MYSQL使用source命令,导入SQL文件
    MYSQL5.7生成列简介及创建
    MYSQL慢查询优化方法及优化原则
    批量提取文件夹下所有目录及文件名称
  • 原文地址:https://www.cnblogs.com/steven9898/p/9115228.html
Copyright © 2011-2022 走看看