python中配置mysql

littleh 发布于 2018/04/08 20:22
阅读 264
收藏 0

Traceback (most recent call last):
  File "E:\python\lib\site-packages\django\utils\autoreload.py", line 225, in wrapper
    fn(*args, **kwargs)
  File "E:\python\lib\site-packages\django\core\management\commands\runserver.py", line 120, in inner_run
    self.check(display_num_errors=True)
  File "E:\python\lib\site-packages\django\core\management\base.py", line 364, in check
    include_deployment_checks=include_deployment_checks,
  File "E:\python\lib\site-packages\django\core\management\base.py", line 351, in _run_checks
    return checks.run_checks(**kwargs)
  File "E:\python\lib\site-packages\django\core\checks\registry.py", line 73, in run_checks
    new_errors = check(app_configs=app_configs)
  File "E:\python\lib\site-packages\django\core\checks\model_checks.py", line 27, in check_all_models
    errors.extend(model.check(**kwargs))
  File "E:\python\lib\site-packages\django\db\models\base.py", line 1200, in check
    errors.extend(cls._check_fields(**kwargs))
  File "E:\python\lib\site-packages\django\db\models\base.py", line 1272, in _check_fields
    errors.extend(field.check(**kwargs))
  File "E:\python\lib\site-packages\django\db\models\fields\__init__.py", line 894, in check
    errors = super().check(**kwargs)
  File "E:\python\lib\site-packages\django\db\models\fields\__init__.py", line 206, in check
    errors.extend(self._check_backend_specific_checks(**kwargs))
  File "E:\python\lib\site-packages\django\db\models\fields\__init__.py", line 303, in _check_backend_specific_checks
    return connections[db].validation.check_field(self, **kwargs)
  File "E:\python\lib\site-packages\django\db\backends\base\validation.py", line 21, in check_field
    field_type = field.db_type(self.connection)
  File "E:\python\lib\site-packages\django\db\models\fields\__init__.py", line 648, in db_type
    return connection.data_types[self.get_internal_type()] % data
  File "E:\python\lib\site-packages\django\utils\functional.py", line 36, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "E:\python\lib\site-packages\django\db\backends\mysql\base.py", line 133, in data_types
    if self.features.supports_microsecond_precision:
  File "E:\python\lib\site-packages\django\utils\functional.py", line 36, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "E:\python\lib\site-packages\django\db\backends\mysql\features.py", line 65, in supports_microsecond_precision
    return self.connection.mysql_version >= (5, 6, 4)
  File "E:\python\lib\site-packages\django\utils\functional.py", line 36, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "E:\python\lib\site-packages\django\db\backends\mysql\base.py", line 345, in mysql_version
    with self.temporary_connection() as cursor:
  File "E:\python\lib\contextlib.py", line 81, in __enter__
    return next(self.gen)
  File "E:\python\lib\site-packages\django\db\backends\base\base.py", line 576, in temporary_connection
    cursor = self.cursor()
  File "E:\python\lib\site-packages\django\db\backends\base\base.py", line 255, in cursor
    return self._cursor()
  File "E:\python\lib\site-packages\django\db\backends\base\base.py", line 232, in _cursor
    self.ensure_connection()
  File "E:\python\lib\site-packages\django\db\backends\base\base.py", line 216, in ensure_connection
    self.connect()
  File "E:\python\lib\site-packages\django\db\backends\base\base.py", line 196, in connect
    self.init_connection_state()
  File "E:\python\lib\site-packages\django\db\backends\mysql\base.py", line 252, in init_connection_state
    cursor.execute('; '.join(assignments))
  File "E:\python\lib\site-packages\django\db\backends\utils.py", line 100, in execute
    return super().execute(sql, params)
  File "E:\python\lib\site-packages\django\db\backends\utils.py", line 68, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "E:\python\lib\site-packages\django\db\backends\utils.py", line 77, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "E:\python\lib\site-packages\django\db\backends\utils.py", line 85, in _execute
    return self.cursor.execute(sql, params)
  File "E:\python\lib\site-packages\django\db\utils.py", line 89, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "E:\python\lib\site-packages\django\db\backends\utils.py", line 83, in _execute
    return self.cursor.execute(sql)
  File "E:\python\lib\site-packages\django\db\backends\mysql\base.py", line 71, in execute
    return self.cursor.execute(query, args)
  File "E:\python\lib\site-packages\pymysql\cursors.py", line 165, in execute
    result = self._query(query)
  File "E:\python\lib\site-packages\pymysql\cursors.py", line 321, in _query
    conn.query(q)
  File "E:\python\lib\site-packages\pymysql\connections.py", line 860, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "E:\python\lib\site-packages\pymysql\connections.py", line 1061, in _read_query_result
    result.read()
  File "E:\python\lib\site-packages\pymysql\connections.py", line 1349, in read
    first_packet = self.connection._read_packet()
  File "E:\python\lib\site-packages\pymysql\connections.py", line 1018, in _read_packet
    packet.check_error()
  File "E:\python\lib\site-packages\pymysql\connections.py", line 384, in check_error
    err.raise_mysql_exception(self._data)
  File "E:\python\lib\site-packages\pymysql\err.py", line 107, in raise_mysql_exception
    raise errorclass(errno, errval)
django.db.utils.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED' at line 1")

 

 

大神们求解啊

加载中
返回顶部
顶部