http://wwty.iteye.com/blog/698239 去看看这个应该能解决你的问题

解决方案 »

  1.   

    Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted.Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave.Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT into autoincrement field which is not the first part in the composed primary key is unsafe.
      

  2.   


    怎么查看mysql的日志,用哪个语句?
      

  3.   

    检查 binlog_format设置,设置为mixed试试
    1.changing the logging mode to "mixed"
     2.turning off warnings (ignoring these warnings)
      

  4.   

    将binlog_format换成row-based or 在更新语句中不使用limit。
      

  5.   

    通过show variables like ‘general_log%’可以看查询日志
    set global general_log=ON;
      

  6.   

    看到存储日志的文件路径,不能用sql查询日志吗
      

  7.   

    可以使用show warnings查看一下,存储过程报告警跟很多内容有关,比如整个存储过程内容未涉及SQL必须带参数NO SQL ,使用过Cursor,使用过if not exists的DDL语句等等
      

  8.   


    show warnings只能查看,我想把错误保存下来,以便我以后查看
      

  9.   

    只有在错误日志中查找
    在SP中捕获错误
    参考
    DECLARE CONTINUE HANDLER FOR SQLSTATE '23000' SET .....
      
    19.2.8.2. DECLARE Handlers
    DECLARE handler_type HANDLER FOR condition_value[,...] statementhandler_type:
        CONTINUE
      | EXIT
      | UNDOcondition_value:
        SQLSTATE [VALUE] sqlstate_value
      | condition_name
      | SQLWARNING
      | NOT FOUND
      | SQLEXCEPTION
      | mysql_error_code
      

  10.   

    没办法,在MYSQL中只有这样,否则就换数据库吧