一.安装Pymysql模块

Python中的pymysql模块
Python中的pymysql模块

二.通过python操作数据库

1.连接数据库

Python中的pymysql模块

2.创建游标对象

Python中的pymysql模块

3.对数据库操作

Python中的pymysql模块
Python中的pymysql模块
Python中的pymysql模块
Python中的pymysql模块

三.查询数据库

1.查询数据记录数

Python中的pymysql模块
Python中的pymysql模块

2.获取下一条查询结果集

Python中的pymysql模块

3.获取指定个数查询结果集

Python中的pymysql模块

4.获取剩下所有的查询结果

Python中的pymysql模块

四.cursor.scroll的用法

Python中的pymysql模块

练习:

Python中的pymysql模块
Python中的pymysql模块
Python中的pymysql模块
Python中的pymysql模块

相关文章: