pandas读取MySql数据
时间:2021-07-01 10:21:17
帮助过:6人阅读
import MySQLdb
2 import pandas as pd
3
4 conn = MySQLdb.connect(host = host,port = port,user = username,passwd = password,db =
db_name)
5
6 df = pd.read_sql(
‘select * from table_name‘,con=
conn)
7
8 conn.close()
很简单,有木有
pandas读取MySql数据
标签:ldb 数据 blog table 忘记 tab code close and