python pymssql__initial-conn.py

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python pymssql__initial-conn.py相关的知识,希望对你有一定的参考价值。

"""
Connecting using Windows Authentication

When connecting using Windows Authentication, 
this is how to combine the database’s hostname and instance name, 
and the Active Directory/Windows Domain name and the username. 
This example uses raw strings (r'...') for the strings that contain a backslash.

RAW STRINGS
https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals

SOURCE
http://pymssql.org/en/latest/pymssql_examples.html#connecting-using-windows-authentication
"""
import pymssql


conn = pymssql.connect(
    host=r'dbhostname\myinstance',
    user=r'companydomain\username',
    password=PASSWORD,
    database='DatabaseOfInterest'
)

以上是关于python pymssql__initial-conn.py的主要内容,如果未能解决你的问题,请参考以下文章

python pymssql__initial-conn.py

python pymssql__basic-features.py

pymssql,无法执行EXEC命令sql

pymssql连接sql server报错:pymssql._pymssql.OperationalError

Python pymssql 插入错误

使用 pymssql 使用 Python 导入 .bak MySQL 数据库