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,就成功了。在此和大家共享遇到的问题的解决办法,期望也能帮助你解决问题。
后一篇:awk中的FS OFS ORS