Skip to content Skip to sidebar Skip to footer

Windows Authentication With Mysqldb In Python

Is there a way to connect to MySQL database with Windows Authentication in Python? It is enabled on MySQL server, I login into it with Microsoft MySQL Server Management Studio no p

Solution 1:

This is the connection string you need to use:

Server=myServerAddress;Database=myDataBase;IntegratedSecurity=yes;Uid=auth_windows;

This option is available from Connector/NET version 6.4.4, but please note that is requires the Windows Native Authentication Plugin must to be installed.

Solution 2:

Based on Jaco's answer but pyodbc library requires slightly different string, or it will produce unrecognized attribute error:

Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;Uid=auth_window;

Post a Comment for "Windows Authentication With Mysqldb In Python"