import pymysqldb = 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()原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。