南django没有使用mysql

时间:2014-10-16 20:48:19

标签: python mysql django django-south

Django = 1.6.7

Pytyhon = 2.7.8

我无法在南方安装syncdb。

如果我指向ENGINE django.db.backends.sqlite3,如果它工作正常但是当我切换到mysql时不起作用。

我拥有它......

我已安装Mysql,South

settings.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

1 个答案:

答案 0 :(得分:1)

对不起,谢谢 Glyn Jackson

  

我可以解决问题,问题是使用的mysql客户端   服务器,使用版本appserv作为服务器。

     

我在生产服务器上尝试过并正确添加表格   迁移。