Python连接Mysql测试

import pymysql

db = pymysql.connect(host="rm-2zei6e64c1k486wp1.mysql.rds.aliyuncs.com", port=3306, user="zhuhaoran", passwd="a%fk&^km%HbZu7O$", db="uat_orderdb", charset='utf8')
cursor = db.cursor() #使用cursor方法创建一个游标
cur.execute("show tables;")
table_number = cur.fetchall()
print(table_number)
cursor.close()
db.close()
上一篇:vant中,van-dropdown-menu-item中open和close事件的顺序


下一篇:ILT是啥