自BINLOG_FORMAT = STATEMENT以来使用语句格式写入二进制日志的不安全语句。

时间:2012-08-29 16:33:58

标签: mysql django-admin

尝试从django管理界面插入值时出现以下错误 -

Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction.
Request Method: POST
Request URL:    *<My URL>*
Django Version: 1.3.1
Exception Type: Warning
Exception Value:    
Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction.
Exception Location: /Library/<Application>/2.7/site-packages/MySQLdb/cursors.py in _warning_check, line 92
Python Executable:  /usr/bin/python
Python Version: 2.7.1

我尝试在网上阅读,但无法正确解决问题。有什么帮助吗?

1 个答案:

答案 0 :(得分:3)

找出问题并解决它。这是因为并非所有的表都是在同一个引擎下创建的(因为mysql 5.0,因为mysql 5.5和旧表在'MyISAM'下,所以新表在'InnoDB'下)。

以下是详细说明 - http://generics7.blogspot.com/2012/08/unsafe-statement-written-to-binary-log.html

在同一个引擎下创建所有表后,它运行正常!