I am using Jupyter Notebooks to learn Python. I would like to connect to a MySQL db hosted locally hosted through MAMP. How would I approach this?
Assuming you have MySQL installed (instructions here for macOS using HomeBrew), you need to:
pip3 install ipython-sql
pip3 install mysqlclient
now you should be able to run these cells and get pretty-printed HTML output:
# %%
%load_ext sql
# %%
%sql mysql+mysqldb://:@localhost/
# %%
%%sql
SELECT *
FROM ;
- 热议问题