-
Notifications
You must be signed in to change notification settings - Fork 562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jupyter Notebook kernel dying when trying to connect to SQL Server with odbc #487
Comments
I'm having trouble getting that trace to work. Bit of extra information though: The Terminal is giving me this error: |
That could be related to microsoft/homebrew-mssql-release#18 , |
@v-chojas this ended up being correct. I appended the bash_profile with the UTC-8 locale and it fixed the issue. Thanks! |
import pandas as pd engine = create_engine("mysql+pymysql://{user}:{pw}@localhost/{db}" OperationalError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on '@localhost' ([Errno 11003] getaddrinfo failed)") |
Look up what error 11003 is, and you should probably start a new issue because everything else in the previous comments here is irrelevant to your situation. |
Environment
Issue
I am currently trying to connect to SQL Operations Studio (SQL Server for mac) through Jupyter Notebook. In Terminal, I use this code to install the driver:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release brew update brew install --no-sandbox msodbcsql17 mssql-tools
And I used this command (from this question: ) to fix a driver problem:
sudo ln -s /usr/local/etc/odbcinst.ini /etc/odbcinst.ini sudo ln -s /usr/local/etc/odbc.ini /etc/odbc.ini
Now I try to run the following code in Jupyter:
`import pyodbc
cnxn = pyodbc.connect('driver={ODBC Driver 17 for SQL Server},
server=###,
database=###,
uid=###,
pwd=###')
cur = cnxn.cursor()
db_cmd = "SELECT TOP (10) * FROM [dbo].[ChargePoints]"
res = cur.execute(db_cmd)`
Then get this error message: "The kernel appears to have died. It will restart automatically." I've tested it and I know it is dying on the second line, pyodbc.connect. I have never tried to do SQL queries from python before so I have no clue where to go from here.
The text was updated successfully, but these errors were encountered: