pymysql:属于python的一个模块
pip3 install pymysql
conn = pymysql.connect(...,charset = 'uft8')
创建游标
conn.cursor(dic)
(1)修改数据,删除数据,增加数据一定要commit
cursor.execut(sql,{}|()|[]) 一定要注意sql注入
(2)fetchone()
fetchmany(4)
fetchall()
cursor.close()
conn.close()
相关文章: