python - South django 不支持 mysql

标签 python mysql django django-south

Django = 1.6.7

Python = 2.7.8

我无法在安装了 south 的情况下制作 syncdb。

如果我指向 ENGINE django.db.backends.sqlite3,如果它运行良好但是当我切换到 mysql 时它不起作用。

我有...

我已经安装了 Mysql , South

设置.py

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'south',
)

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'bag',
        'HOST' : '127.0.0.1',
        'PASSWORD' : '123',
        'USER' : 'root',
        'PORT' : '3306'
    }
}

C:\Users\NEO\Desktop\APP\a>manage.py syncdb
Syncing...
Traceback (most recent call last):
  File "C:\Users\NEO\Desktop\APP\a\manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 399, in execute
_command_line
    utility.execute()
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Python27\lib\site-packages\django\core\management\base.py", line 242, in run_from_ar
    self.execute(*args, **options.__dict__)
  File "C:\Python27\lib\site-packages\django\core\management\base.py", line 285, in execute
    output = self.handle(*args, **options)
  File "C:\Python27\lib\site-packages\django\core\management\base.py", line 415, in handle
    return self.handle_noargs(**options)
  File "C:\Python27\lib\site-packages\south-1.0-py2.7.egg\south\management\commands\syncdb.py",
 89, in handle_noargs
    db.connection_init()
  File "C:\Python27\lib\site-packages\south-1.0-py2.7.egg\south\db\mysql.py", line 184, in conn
n_init
    if cursor.execute("SHOW variables WHERE Variable_Name='default_storage_engine';"):
  File "C:\Python27\lib\site-packages\django\db\backends\util.py", line 69, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "C:\Python27\lib\site-packages\django\db\backends\util.py", line 51, in execute
    return self.cursor.execute(sql)
  File "C:\Python27\lib\site-packages\django\db\backends\mysql\base.py", line 124, in execute
    return self.cursor.execute(query, args)
  File "C:\Python27\lib\site-packages\MySQLdb\cursors.py", line 207, in execute
    if not self._defer_warnings: self._warning_check()
  File "C:\Python27\lib\site-packages\MySQLdb\cursors.py", line 117, in _warning_check
    warn(w[-1], self.Warning, 3)
_mysql_exceptions.Warning: Incorrect string value: '\xEDfico,...' for column 'Value' at row 1

最佳答案

抱歉,谢谢 Glyn Jackson

and I could solve the problem, the problem was the mysql client used server, used a version appserv as a server.

I tried it on a production server and add tables and properly migration.

关于python - South django 不支持 mysql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26413620/

相关文章:

python - 第一次识别输入错误,第二次开始运行

php - 单个 CakePHP query() 调用中的多个 SQL 语句?

java - 将 UTF8 文本插入 latin1 列时出现 "Incorrect string value:"MySQL 问题

python - Django 表单和 Material Design Lite

python - Django 多个搜索词

python - MySQLdb Python - 测试数据库

python - 类型错误 : must be string or buffer, 不是整数

python - 从 python 帮助中提取示例到 ipython session 中

php - MySQL 从不同的表中检索 2 个值

android - 将 GPS 数据从 Android 发送到 Django 的最聪明的方法