1. 程式人生 > >python寫入mysql

python寫入mysql

cut class nbsp port sele fetchone fetch select 0.12

import pymysql
conn = pymysql.connect(host=‘192.168.70.129‘,port=3306,user=‘root‘,passwd=‘123456‘,db=‘my‘)
cursor = conn.cursor()
cursor.execute("select * from student")
row_1 = cursor.fetchone()
print row_1
cursor.close()
conn.close()

python寫入mysql