coding=utf-8
import pymysql
連接數(shù)據(jù)庫
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')
得到所有數(shù)據(jù)
res = cursor.fetchall()
for i in res:
print(i)