Hi,
I am unable to connect to MySQL.
I repeated the example in the documentation and nothing…frustration…frustration…frustration.
Thanks in advance
Hi,
I am unable to connect to MySQL.
I repeated the example in the documentation and nothing…frustration…frustration…frustration.
Thanks in advance
Can you share more details about your setup and code and what errors you are getting?
import streamlit as st
import pandas as pd
from sqlalchemy import create_engine
SQL_script = st.text_area(label=‘SQL Input’, value=‘SELECT * FROM df’)
@st.cache(allow_output_mutation=True)
def get_connection():
return create_engine(“mysql+pymysql://{user}:{pw}@localhost/{db}”
.format(user=“root”,
pw=“Platinum79”,
db=“ebird”))
@st.cache
def load_data(SQL_script):
with st.spinner(‘Loading Data…’):
df = pd.read_sql_query(SQL_script, get_connection())
return df
raw_data = load_data(SQL_script)
raw_data
I think the main problem is with ```
mysqlclient
![image|690x423](upload://2xoOVjkyjGciTPatd8MuKkrHCLj.png)
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.