Pymssql installation Test

Source: Internet
Author: User
Tags mssqlserver

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.