推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
gyy028012
V2EX  ›  Python

用 pymssql 连接 sqlserver 数据库报错 20002

  •  
  •   gyy028012 · Mar 10, 2020 · 3160 views
    This topic created in 2292 days ago, the information mentioned may be changed or developed.
    大佬们有遇到这个情况吗?
    (20002, b'DB-Lib error message 20002, severity 9:\nAdaptive Server connection failed
    3 replies    2020-03-10 14:04:18 +08:00
    gyy028012
        1
    gyy028012  
    OP
       Mar 10, 2020
    感觉是电脑上缺少什么插件,相同的代码在另一台电脑运行正常
    qile1
        2
    qile1  
       Mar 10, 2020 via Android
    首先确认下在出问题电脑上面用数据库自带软件可以连接不,有时候数据库链接需要添加实例名,如果可以,排除服务器问题,那核对下你 python 版本和位数,32 位的需要安装 32 位的 pymssql,你可以把另外一台好使的程序用 pyinstall 简单打包为 exe,拿到出问题电脑上面试试,如果也报错那我只能建议你重装系统了,不报错在慢慢排查吧,我之前用了好几个天排查这个问题!

    顺便问下,数据库链接超时通过代码有没有重试办法?
    gyy028012
        3
    gyy028012  
    OP
       Mar 10, 2020
    自带的软件连接正常,之前就是打包好的 exe 文件,以前是正常的,这两天突然就连不上了,可能只有重装系统了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2602 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 07:44 · PVG 15:44 · LAX 00:44 · JFK 03:44
    ♥ Do have faith in what you're doing.