mkleehammer/pyodbc

Unable to Connect to Azure SQL Server using ODBC Driver 18 for SQL Server with a "@" in my user name

Opened this issue · 2 comments

I am encountering an issue when attempting to connect to my Azure SQL Server database using pyodbc and the ODBC Driver 18 for SQL Server on Ubuntu. Below are the details:

Environment

OS: Ubuntu
ODBC Driver: ODBC Driver 18 for SQL Server
pyodbc Version: 5.2.0
Python Version: Python 3.12.3

Connection Details:

Server: martins.database.windows.net
Database: Stage-MartinsPoint
Username: insightin-martinpoint@martins-point
Password: matins123

Issue

I am getting the error message

Connection failed: ('42000', "[42000] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Cannot open server 'martins-point' requested by the login.

I have tried to double cote like "insightin-martinpoint@martins-point" and also "insightin-martinpoint//@martins-point"

is there any way to fix this?

Is this a sql login or a microsoft "entra" account?

This is a SQL login