执行命令python manage.py db migrate后出错,前面的步骤都跟上了,求解!
错误如下:
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 26, in <module>
manager.run()
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\flask_script\__init__.py", line 417, in run
result = self.handle(argv[0], argv[1:])
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\flask_script\__init__.py", line 386, in handle
res = handle(*args, **config)
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\flask_script\commands.py", line 216, in __call__
return self.run(*args, **kwargs)
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\flask_migrate\__init__.py", line 197, in migrate
version_path=version_path, rev_id=rev_id)
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\alembic\command.py", line 176, in revision
script_directory.run_env()
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\alembic\script\base.py", line 427, in run_env
util.load_python_file(self.dir, 'env.py')
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\alembic\util\pyfiles.py", line 81, in load_python_file
module = load_module_py(module_id, path)
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\alembic\util\compat.py", line 83, in load_module_py
spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "migrations\env.py", line 87, in <module>
run_migrations_online()
File "migrations\env.py", line 72, in run_migrations_online
connection = engine.connect()
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\sqlalchemy\engine\base.py", line 2102, in connect
return self._connection_cls(self, **kwargs)
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\sqlalchemy\engine\base.py", line 90, in __init__
if connection is not None else engine.raw_connection()
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\sqlalchemy\engine\base.py", line 2188, in raw_connection
self.pool.unique_connection, _connection)
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\sqlalchemy\engine\base.py", line 2162, in _wrap_pool_connect
e, dialect, self)
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\sqlalchemy\engine\base.py", line 1476, in _handle_dbapi_exception_noconnection
exc_info
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\sqlalchemy\util\compat.py", line 203, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\sqlalchemy\util\compat.py", line 186, in reraise
raise value.with_traceback(tb)
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\sqlalchemy\engine\base.py", line 2158, in _wrap_pool_connect
return fn()
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\sqlalchemy\pool.py", line 345, in unique_connection
return _ConnectionFairy._checkout(self)
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\sqlalchemy\pool.py", line 784, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\sqlalchemy\pool.py", line 532, in checkout
rec = pool._do_get()
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\sqlalchemy\pool.py", line 1280, in _do_get
return self._create_connection()
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\sqlalchemy\pool.py", line 350, in _create_connection
return _ConnectionRecord(self)
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\sqlalchemy\pool.py", line 477, in __init__
self.__connect(first_connect_check=True)
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\sqlalchemy\pool.py", line 667, in __connect
connection = pool._invoke_creator(self)
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\sqlalchemy\engine\strategies.py", line 106, in connect
return dialect.connect(*cargs, **cparams)
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\sqlalchemy\engine\default.py", line 410, in connect
return self.dbapi.connect(*cargs, **cparams)
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\pymysql\__init__.py", line 90, in Connect
return Connection(*args, **kwargs)
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\pymysql\connections.py", line 699, in __init__
self.connect()
File "X:\Users\Administrator\Desktop\python\29\Travel\venv\lib\site-packages\pymysql\connections.py", line 967, in connect
raise exc
sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on '127.0.0.1' ([WinError 10061] 由于目标计算机积极拒绝,无法连接。)") (Background on this error at: http://sqlalche.me/e/e3q8)