pandas读取sql数据转成Dataframe

Scroll Down

from sqlalchemy import create_engine
import pandas as pd
import pymysql

if name == 'main':
conn = pymysql.connect(
host = "192.168.24.104",
port = 3306,
user = "guopengfa",
passwd = "1111aaaa",
db = "fba"
)
cursor = conn.cursor()
cursor.execute("select * from fba_listing_breaking_num")
value = cursor.fetchall()
conn.close()
data = pd.DataFrame(value)
print(data)