Platform: Windows 7 32-bit
Database: SQL Server 2008
Python 2.7 & pymssql modules
Module installation instructions for database and Python omitted
The following test code is posted: Simple connection Database Testing
1 Import 2 4 conn = Pymssql.connect (host="localhost", user=" SA ", password=" ********", database="master" "UTF8", login_timeout = 5) 5
A test run may appear:
conn = Pymssql.connect (host= "localhost", user= "sa", password= "sa", database= "Master", CharSet = "UTF8", Login_timeout = 5 )
File "Pymssql.pyx", line 636, in Pymssql.connect (pymssql.c:10178)
Pymssql. Operationalerror: (20009, ' db-lib error message 20009, severity 9:\nunable to Connect:adaptive Server is unavailable or D OES not exist\nnet-lib error during Unknown error (10035) \ n ')
So the question is, why can't we?
Reference Solutions:
Open the SQL Server TIC/IP service in the following ways:
1. Open SQL Configuration Manager (inside the Config Tool folder)
2, find the protocol for SQL Server-MSSQLSERVER in the left left box
3, locate the TCP/IP settings enabled in the Right and right box
4, locate the SQL Server service in left left left box
5, locate the SQL Server (MSSQLSERVER) Restart in right-to-right-hand box
Configuration is complete, I will be able to connect after Setup is complete.
Pymssql installation Test