为了账号安全,请及时绑定邮箱和手机立即绑定

syncdb上的Django未知系统变量'TRANSACTION'

syncdb上的Django未知系统变量'TRANSACTION'

慕田峪9158850 2021-03-18 15:11:43
我的本地Django正在运行在我们的服务器上运行的manage.py syncdb脚本。这是我在运行时看到的错误消息python manage.py syncdb,OperationalError:(1193,“未知的系统变量'TRANSACTION'”)它看起来像一个MySQL问题,仅供参考,我在虚拟环境中安装了Django 1.5.1和MySQL-python 1.2.4,并且正在运行MySQL 5.6.10版本。这是我当前的完整虚拟环境,来自pip list,Django (1.5.1)MySQL-python (1.2.4)pymongo (2.5.2)python-cjson (1.0.5)wsgiref (0.1.2)我对Django不太熟练,Google没有发现任何问题,有人可以告诉我这里会发生什么吗?下面的命令的完整引用Traceback (most recent call last):  File "/Users/jamesmcmahon/src/business-intelligence/mongo2mysql/venv/lib/python2.7/site-packages/django/core/management/base.py", line 222, in run_from_argv    self.execute(*args, **options.__dict__)  File "/Users/jamesmcmahon/src/business-intelligence/mongo2mysql/venv/lib/python2.7/site-packages/django/core/management/base.py", line 255, in execute    output = self.handle(*args, **options)  File "/Users/jamesmcmahon/src/business-intelligence/mongo2mysql/venv/lib/python2.7/site-packages/django/core/management/base.py", line 385, in handle    return self.handle_noargs(**options)  File "/Users/jamesmcmahon/src/business-intelligence/mongo2mysql/venv/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 56, in handle_noargs    cursor = connection.cursor()  File "/Users/jamesmcmahon/src/business-intelligence/mongo2mysql/venv/lib/python2.7/site-packages/django/db/backends/__init__.py", line 326, in cursor    cursor = util.CursorWrapper(self._cursor(), self)  File "/Users/jamesmcmahon/src/business-intelligence/mongo2mysql/venv/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 405, in _cursor    self.connection = Database.connect(**kwargs)  File "/Users/jamesmcmahon/src/business-intelligence/mongo2mysql/venv/lib/python2.7/site-packages/MySQLdb/__init__.py", line 81, in Connect    return Connection(*args, **kwargs)
查看完整描述

3 回答

?
婷婷同学_

TA贡献1844条经验 获得超8个赞

采用


数据库= {


'default': {

    'NAME': 'test',

    'ENGINE': 'django.db.backends.mysql',

    'USER': 'redacted',

    'PASSWORD': 'redacted',

    'HOST': 'localhost'

    'OPTIONS': { "init_command": "SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED"}   

},


}


即没有“ storage_engine = INNODB”。默认情况下,最新版本的MySql引擎为INNODB。


查看完整回答
反对 回复 2021-03-30
  • 3 回答
  • 0 关注
  • 136 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信