mysql-由于BINLOG_FORMAT = STATEMENT,因此使用语句格式将不安全的语句写入二进制日志.
作者:互联网
尝试从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
我尝试在网络上阅读,但是无法解决该问题.有什么帮助吗?
解决方法:
找出问题并解决.这是因为并非所有表都是在同一引擎下创建的(由于mysql 5.5,新表位于’InnoDB’下,而由于mysql 5.0,旧表位于’MyISAM’下).
这是详细说明-http://generics7.blogspot.com/2012/08/unsafe-statement-written-to-binary-log.html
在同一引擎下创建所有表后,它可以正常工作!
标签:django-admin,mysql 来源: https://codeday.me/bug/20191127/2076367.html