数据库迁移的时候报错,想问下这个错误是什么原因?
XingshengLiu opened this issue · 3 comments
E:\PyGitHub\HttpRunnerManager>python36 manage.py makemigrations ApiManager
Traceback (most recent call last):
File "D:\python36\lib\site-packages\django\db\backends\base\base.py", line 216
, in ensure_connection
self.connect()
File "D:\python36\lib\site-packages\django\db\backends\base\base.py", line 194
, in connect
self.connection = self.get_new_connection(conn_params)
File "D:\python36\lib\site-packages\django\db\backends\mysql\base.py", line 23
6, in get_new_connection
return Database.connect(**conn_params)
File "D:\python36\lib\site-packages\MySQLdb_init_.py", line 86, in Connect
return Connection(*args, **kwargs)
File "D:\python36\lib\site-packages\MySQLdb\connections.py", line 204, in in
it
super(Connection, self).init(*args, **kwargs2)
_mysql_exceptions.OperationalError: (2059, )
Traceback (most recent call last):
File "manage.py", line 22, in
execute_from_command_line(sys.argv)
File "D:\python36\lib\site-packages\django\core\management_init_.py", line
371, in execute_from_command_line
utility.execute()
File "D:\python36\lib\site-packages\django\core\management_init_.py", line
365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "D:\python36\lib\site-packages\django\core\management\base.py", line 288,
in run_from_argv
self.execute(*args, **cmd_options)
File "D:\python36\lib\site-packages\django\core\management\base.py", line 332,
in execute
self.check()
File "D:\python36\lib\site-packages\django\core\management\base.py", line 364,
in check
include_deployment_checks=include_deployment_checks,
File "D:\python36\lib\site-packages\django\core\management\base.py", line 351,
in run_checks
return checks.run_checks(**kwargs)
File "D:\python36\lib\site-packages\django\core\checks\registry.py", line 73,
in run_checks
new_errors = check(app_configs=app_configs)
File "D:\python36\lib\site-packages\django\core\checks\model_checks.py", line
27, in check_all_models
errors.extend(model.check(**kwargs))
File "D:\python36\lib\site-packages\django\db\models\base.py", line 1200, in c
heck
errors.extend(cls.check_fields(**kwargs))
File "D:\python36\lib\site-packages\django\db\models\base.py", line 1272, in _
check_fields
errors.extend(field.check(**kwargs))
File "D:\python36\lib\site-packages\django\db\models\fields_init.py", line
894, in check
errors = super().check(**kwargs)
File "D:\python36\lib\site-packages\django\db\models\fields_init.py", line
206, in check
errors.extend(self.check_backend_specific_checks(**kwargs))
File "D:\python36\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 "D:\python36\lib\site-packages\django\db\backends\base\validation.py", li
ne 21, in check_field
field_type = field.db_type(self.connection)
File "D:\python36\lib\site-packages\django\db\models\fields_init.py", line
648, in db_type
return connection.data_types[self.get_internal_type()] % data
File "D:\python36\lib\site-packages\django\utils\functional.py", line 36, in _
get_
res = instance.dict[self.name] = self.func(instance)
File "D:\python36\lib\site-packages\django\db\backends\mysql\base.py", line 13
3, in data_types
if self.features.supports_microsecond_precision:
File "D:\python36\lib\site-packages\django\utils\functional.py", line 36, in _
get_
res = instance.dict[self.name] = self.func(instance)
File "D:\python36\lib\site-packages\django\db\backends\mysql\features.py", lin
e 65, in supports_microsecond_precision
return self.connection.mysql_version >= (5, 6, 4)
File "D:\python36\lib\site-packages\django\utils\functional.py", line 36, in _
get_
res = instance.dict[self.name] = self.func(instance)
File "D:\python36\lib\site-packages\django\db\backends\mysql\base.py", line 34
5, in mysql_version
with self.temporary_connection() as cursor:
File "D:\python36\lib\contextlib.py", line 81, in enter
return next(self.gen)
File "D:\python36\lib\site-packages\django\db\backends\base\base.py", line 576
, in temporary_connection
cursor = self.cursor()
File "D:\python36\lib\site-packages\django\db\backends\base\base.py", line 255
, in cursor
return self._cursor()
File "D:\python36\lib\site-packages\django\db\backends\base\base.py", line 232
, in cursor
self.ensure_connection()
File "D:\python36\lib\site-packages\django\db\backends\base\base.py", line 216
, in ensure_connection
self.connect()
File "D:\python36\lib\site-packages\django\db\utils.py", line 89, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "D:\python36\lib\site-packages\django\db\backends\base\base.py", line 216
, in ensure_connection
self.connect()
File "D:\python36\lib\site-packages\django\db\backends\base\base.py", line 194
, in connect
self.connection = self.get_new_connection(conn_params)
File "D:\python36\lib\site-packages\django\db\backends\mysql\base.py", line 23
6, in get_new_connection
return Database.connect(**conn_params)
File "D:\python36\lib\site-packages\MySQLdb_init.py", line 86, in Connect
return Connection(*args, **kwargs)
File "D:\python36\lib\site-packages\MySQLdb\connections.py", line 204, in in
it
super(Connection, self).init(*args, **kwargs2)
django.db.utils.OperationalError: (2059, )
怀疑是数据库表有问题,就把django卸载重装了一次,但是还是提示同样的错误
@yinquanwang 可以看下吗
能描述一下操作步骤和数据库的状态吗