当前位置:Gxlcms > 数据库问题 > python3连接mysql

python3连接mysql

时间:2021-07-01 10:21:17 帮助过:26人阅读

= pymysql.connect(host=‘10.60.10.11‘,port=3306,user=‘root‘,passwd=‘xxxxx‘,db=‘haoxx‘) cur = conn.cursor() cur.execute("select car_id,car_name from car where car_id < 5") for i in cur.fetchall(): print(i) cur.close() conn.close()

 

python3连接mysql

标签:print   python   0.11   hal   xxx   xxxx   logs   pass   exec   

人气教程排行