python链接mysql

import pymysql
conn = pymysql.connect(host='192.168.1.210', port=3306, user='root', passwd='ubuntu',
db='mysql')
cur = conn.cursor()
cur.execute("show full columns from trade")
row_1 = cur.fetchone()
print (row_1)

  

posted @ 2017-07-15 13:39  haha1680737  阅读(120)  评论(0编辑  收藏  举报