mysql - Windows Authentication with MySQLdb in Python -


is there way connect mysql database windows authentication in python? enabled on mysql server, login microsoft mysql server management studio no problem. however, usual setup:

import mysqldb db = mysqldb.connect(host="sampleserver\\demo",                       db="sample")  

doesnt seem work. in fact, host not recognized. our dba didnt give me endpoint aside host. works management studio.

edit 1

as per suggestion in answer, tried connecting connection string method pyodbc library.

import pyodbc cnxn = pyodbc.connect("driver={sql server};"                       "server=server_name\\demo;"                       "database=sample;"                       "uid=auth_windows") 

double backslash, i'm escaping backsalsh in server name

getting long error message:

error: ('28000', "[28000] [microsoft][odbc sql server driver][sql server]login failed user 'auth_windows'. (18456) (sqldriverconnect);  [28000] [microsoft][odbc sql server driver][sql server]login failed user 'auth_windows'. (18456)") 

when tried add integratedsecurity=yes, get:

[01s00] [microsoft][odbc sql server driver]invalid connection string attribute (0) 

this connection string need use:

server=myserveraddress;database=mydatabase;integratedsecurity=yes;uid=auth_windows; 

this option available connector/net version 6.4.4, please note requires windows native authentication plugin must installed.


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -