SyntaxError: Invalid Syntax Query

It looks to me like there is too much going on inside st.dataframe. Try handling your connection and querying of data first, then feed the result into st.dataframe.

mydb = connector.connect(host="96.242.223.246", database = 'FreeWeibo',user="abc",  
                         passwd="abc",use_pure=True)
query = "Select * from FreeWeiboPosts"
data = pd.read_sql(query,mydb)
st.dataframe(data)
mydb.close() #close the connection