python连接mysql
import pymysql
conn = pymysql.connect(host='localhost',user='root',passwd='root',db='test',port=3306,charset='utf8')
cur = conn.cursor()
sql = '''create table if not exists fish
(date1 char(12) primary key not null,
name char(10) not null,
nums int not null,
price decimal(10,2) not null);'''
conn.commit()

浙公网安备 33010602011771号