coding=utf-8
import pymysql
连接数据库
db = pymysql.connect(host='61.164.208.174',user='root_read',passwd='12345,abcde',db='db_rcld_zj_statistics',port=39306,charset='utf8')
cursor = db.cursor()
cursor.execute('SELECT * FROM t_acq_data_20160830 where SHIP_ID =30698')
得到所有数据
res = cursor.fetchall()
for i in res:
print(i)
网友评论