python操作数据库

import pymysql

conn = pymysql.connect(host='192.168.10.124',port=3306,user='root',passwd='root',db='cloud',charset='utf8mb4')

cursor = conn.cursor()
sql = '''具体的sql语句

具体的sql语句

具体的sql语句
'''
cursor.execute(sql)
conn.commit()
cursor.close()
conn.close()

posted on 2017-05-10 14:46  sunshine_zhf  阅读(108)  评论(0)    收藏  举报

导航