python连接不上数据库_python连接mysql数据库遇到的问题

Traceback (most recent call last):

File "F:/Python_Document/sql/2.py", line 19, in

Base.metadata.create_all(engine)#创建表结构

File "D:\python3.6\lib\site-packages\sqlalchemy-1.2.10-py3.6-win-amd64.egg\sqlalchemy\sql\schema.py", line 4005, in create_all

File "D:\python3.6\lib\site-packages\sqlalchemy-1.2.10-py3.6-win-amd64.egg\sqlalchemy\engine\base.py", line 1939, in _run_visitor

File "D:\python3.6\lib\contextlib.py", line 82, in __enter__

return next(self.gen)

File "D:\python3.6\lib\site-packages\sqlalchemy-1.2.10-py3.6-win-amd64.egg\sqlalchemy\engine\base.py", line 1932, in _optional_conn_ctx_manager

File "D:\python3.6\lib\site-packages\sqlalchemy-1.2.10-py3.6-win-amd64.egg\sqlalchemy\engine\base.py", line 2123, in contextual_connect

File "D:\python3.6\lib\site-packages\sqlalchemy-1.2.10-py3.6-win-amd64.egg\sqlalchemy\engine\base.py", line 2162, in _wrap_pool_connect

File "D:\python3.6\lib\site-packages\sqlalchemy-1.2.10-py3.6-win-amd64.egg\sqlalchemy\engine\base.py", line 1476, in _handle_dbapi_exception_noconnection

File "D:\python3.6\lib\site-packages\sqlalchemy-1.2.10-py3.6-win-amd64.egg\sqlalchemy\util\compat.py", line 265, in raise_from_cause

File "D:\python3.6\lib\site-packages\sqlalchemy-1.2.10-py3.6-win-amd64.egg\sqlalchemy\util\compat.py", line 248, in reraise

File "D:\python3.6\lib\site-packages\sqlalchemy-1.2.10-py3.6-win-amd64.egg\sqlalchemy\engine\base.py", line 2158, in _wrap_pool_connect

File "D:\python3.6\lib\site-packages\sqlalchemy-1.2.10-py3.6-win-amd64.egg\sqlalchemy\pool.py", line 403, in connect

File "D:\python3.6\lib\site-packages\sqlalchemy-1.2.10-py3.6-win-amd64.egg\sqlalchemy\pool.py", line 791, in _checkout

File "D:\python3.6\lib\site-packages\sqlalchemy-1.2.10-py3.6-win-amd64.egg\sqlalchemy\pool.py", line 532, in checkout

File "D:\python3.6\lib\site-packages\sqlalchemy-1.2.10-py3.6-win-amd64.egg\sqlalchemy\pool.py", line 1196, in _do_get

File "D:\python3.6\lib\site-packages\sqlalchemy-1.2.10-py3.6-win-amd64.egg\sqlalchemy\util\langhelpers.py", line 66, in __exit__

File "D:\python3.6\lib\site-packages\sqlalchemy-1.2.10-py3.6-win-amd64.egg\sqlalchemy\util\compat.py", line 249, in reraise

File "D:\python3.6\lib\site-packages\sqlalchemy-1.2.10-py3.6-win-amd64.egg\sqlalchemy\pool.py", line 1193, in _do_get

File "D:\python3.6\lib\site-packages\sqlalchemy-1.2.10-py3.6-win-amd64.egg\sqlalchemy\pool.py", line 350, in _create_connection

File "D:\python3.6\lib\site-packages\sqlalchemy-1.2.10-py3.6-win-amd64.egg\sqlalchemy\pool.py", line 477, in __init__

File "D:\python3.6\lib\site-packages\sqlalchemy-1.2.10-py3.6-win-amd64.egg\sqlalchemy\pool.py", line 674, in __connect

File "D:\python3.6\lib\site-packages\sqlalchemy-1.2.10-py3.6-win-amd64.egg\sqlalchemy\engine\strategies.py", line 106, in connect

File "D:\python3.6\lib\site-packages\sqlalchemy-1.2.10-py3.6-win-amd64.egg\sqlalchemy\engine\default.py", line 412, in connect

File "pymssql.pyx", line 641, in pymssql.connect (pymssql.c:10824)

sqlalchemy.exc.OperationalError: (pymssql.OperationalError) (20002, b'DB-Lib error message 20002, severity 9:\nAdaptive Server connection failed (localhost:3307)\n') (Background on this error at: http://sqlalche.me/e/e3q8)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值