加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

python连接pymssql报OperationError:20009...错误

(2017-05-11 21:11:09)
分类: python
解决办法:
搜索到stackoverflow的一个答案(连接:http://stackoverflow.com/questions/19348255/pymssql-operationalerror-db-lib-error-message-20009-severity-9),上面的一个回答:

I encountered the same issue. It turns out that I didn't open up TCP/IP access for my local SQL server.

Do a quick test whether it's caused by this, you can try to connect to a remote server with the same code, if it works, it means something wrong with your local server.

So just open the access to your 127.0.0.1:1433 in the SQL server configuration manager. Steps:

Start->All Programs->Microsoft Sql Server 20XX->Configuration Tools->Sql server configuratoin Manager
Sql Server Network COnfiguration->Protocals for MSSQLSERVER
TCP/IP->Properties->IP Addresses. Find the 127.0.0.1 and change the "Enabled" to "Yes". You can do it for all the IPs if you want.
按照他的方法(记得TCP/IP这个总的也要启动的),设置后,但是还是不行,就想到是不是自己的端口和默认的不一样,然后在里面找到端口,然后连接的时候,在127.0.0.1:2796,就成功了。在此和大家共享遇到的问题的解决办法,期望也能帮助你解决问题。

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有