1. 首页
  2. 数据库
  3. 其它
  4. python的mysql数据查询及报错AttributeError: ‘Connection’ object has no attribute ‘curson’

python的mysql数据查询及报错AttributeError: ‘Connection’ object has no attribute ‘curson’

上传者: 2021-01-17 01:48:49上传 PDF文件 21.92KB 热度 114次
import pymysql #创建连接 con = pymysql.connect(host='localhost',user='root',password='123456',port=3306,database='zhy') #创建游标对象 cur = con.curson() #编写查询的sql语句 sql = 'select * from t_student' try: cur.execute(sql) print(查询成功) students = cur.fetchall() print(students) except Exception as
用户评论