P错误14274:pymssql._pymssql.OperationalError) (20009, b'DB-Lib error message 20009, severity 9:\nUnable to connect: Adaptive Server is unavailable or does not exist (#SyStem@123.57.144.189)\n')

问题描述:

  pymssql模块连接sqlserver出现如下错误:

pymssql._pymssql.OperationalError) (20009, bDB-Lib error message 20009, severity 9:\nUnable to connect: Adaptive Server is unavailable or does not exist (#SyStem@123.57.144.189)\n)

 

解决办法:

  1. 打开“SQL Server Configuration Manager”,找不到的话,可在计算机管理 -> 服务和应用程序中找到。
  2. 在SQL Server Network Configuration -> Protocols for SQLEXPRESS中启用TCP/IP协议, TCP/IP -> Properties -> IP Addresses 修改里面ip为127.0.0.1的启用状态。
  3. TCP/IP -> Properties -> IP Addresses,在TCP/IP节点上打开属性窗口,在IPALL条目中,清除TCP Dynamic Ports的值,在TCP Port中填写1433,sql server默认的端口号是1433。
  4. 重要 ,启动SQL Browser Service。sql server express默认是禁止该服务,改为”自动“,并启动它。
  5. 重启sql server服务。  

P错误14274:pymssql._pymssql.OperationalError) (20009, b'DB-Lib error message 20009, severity 9:\nUnable to connect: Adaptive Server is unavailable or does not exist (#SyStem@123.57.144.189)\n')

 

P错误14274:pymssql._pymssql.OperationalError) (20009, b'DB-Lib error message 20009, severity 9:\nUnable to connect: Adaptive Server is unavailable or does not exist (#SyStem@123.57.144.189)\n')

上一篇:arcgis sde 连接oracle 存数据时报错:Underlying DBMS error[ORA-29875:无法执行 ODCIINDEXINSERT例行程序


下一篇:Mysql Select的字段必须包含在Group By中如何解决