python对 MySQL 数据库进行增删改查的脚本
# -*- coding: utf-8 -*- import pymysql import xlrd # import codecs #连接数据库 conn = pymysql.connect(host='127.0.0.1', port=3306, user='root', passwd='', db='test_hvr', charset='utf8') cursor = conn.cursor() # 查询数据库 effect_row = cursor.execute("select * from kkpb_account where user_name='18800000000'")
下载地址
用户评论