现在又成这样了
(venv) D:\python程序\examination>python manage.py migrate
Traceback (most recent call last):
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\pymysql\connections.py", line 920, in connect
**kwargs)
File "C:\Users\ianke\AppData\Local\Programs\Python\Python37\lib\socket.py", line 727, in create_connection
raise err
File "C:\Users\ianke\AppData\Local\Programs\Python\Python37\lib\socket.py", line 716, in create_connection
sock.connect(sa)
ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\django\db\backends\base\base.py", line 213, in ensu
re_connection
self.connect()
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\django\db\backends\base\base.py", line 189, in conn
ect
self.connection = self.get_new_connection(conn_params)
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\django\db\backends\mysql\base.py", line 274, in get
_new_connection
conn = Database.connect(**conn_params)
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\pymysql\__init__.py", line 90, in Connect
return Connection(*args, **kwargs)
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\pymysql\connections.py", line 699, in __init__
self.connect()
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\pymysql\connections.py", line 967, in connect
raise exc
pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on 'localhost' ([WinError 10061] 由于目标计算机积极
拒绝,无法连接。)")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\django\core\management\__init__.py", line 363, in e
xecute_from_command_line
utility.execute()
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\django\core\management\__init__.py", line 355, in e
xecute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\django\core\management\base.py", line 283, in run_f
rom_argv
self.execute(*args, **cmd_options)
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\django\core\management\base.py", line 327, in execu
te
self.check()
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\django\core\management\base.py", line 359, in check
include_deployment_checks=include_deployment_checks,
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\django\core\management\commands\migrate.py", line 6
1, in _run_checks
issues = run_checks(tags=[Tags.database])
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\django\core\checks\registry.py", line 81, in run_ch
ecks
new_errors = check(app_configs=app_configs)
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\django\core\checks\database.py", line 10, in check_
database_backends
issues.extend(conn.validation.check(**kwargs))
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\django\db\backends\mysql\validation.py", line 9, in
check
issues.extend(self._check_sql_mode(**kwargs))
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\django\db\backends\mysql\validation.py", line 13, i
n _check_sql_mode
with self.connection.cursor() as cursor:
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\django\db\backends\base\base.py", line 254, in curs
or
return self._cursor()
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\django\db\backends\base\base.py", line 229, in _cur
sor
self.ensure_connection()
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\django\db\backends\base\base.py", line 213, in ensu
re_connection
self.connect()
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\django\db\utils.py", line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\django\utils\six.py", line 685, in reraise
raise value.with_traceback(tb)
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\django\db\backends\base\base.py", line 213, in ensu
re_connection
self.connect()
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\django\db\backends\base\base.py", line 189, in conn
ect
self.connection = self.get_new_connection(conn_params)
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\django\db\backends\mysql\base.py", line 274, in get
_new_connection
conn = Database.connect(**conn_params)
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\pymysql\__init__.py", line 90, in Connect
return Connection(*args, **kwargs)
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\pymysql\connections.py", line 699, in __init__
self.connect()
File "C:\Users\ianke\AppData\Roaming\Python\Python37\site-packages\pymysql\connections.py", line 967, in connect
raise exc
django.db.utils.OperationalError: (2003, "Can't connect to MySQL server on 'localhost' ([WinError 10061] 由于目标计算机
积极拒绝,无法连接。)")
(venv) D:\python程序\examination>