mysql connection issue - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Data Science (https://python-forum.io/forum-44.html) +--- Thread: mysql connection issue (/thread-10838.html) |
mysql connection issue - aaditya2000 - Jun-09-2018 Hello: Below is the connection code & i am getting following error, please me what wrong i am doing. Any help is greatly appreciated. import pandas as pd import sqlalchemy as sa import mysql.connector as mc cnx = mc.connect(host='11.11.11.11',port=3306,database='kafka',user='root',password='xxxxxxx') cur=cnx.cursor() query = ("select * from kafka_test where flag = 0 order by id limit 20") df = pd.read_sql_query(query,con=cnx) print(df)ERROR:-
|