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)
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)