pytho通过pymysql模块获取数据表的行数
源码如下:import pymysqlcon = pymysql.connect(host='localhost', port=3306, passwd='123456', user='step',db='sum')cmd = con.cursor()cmd.execute("explain select * from sum;")info = cmd.fetchall()[0][9]print(info)con.close()执行结果: