#!/usr/bin/env python import pymysql conn = pymysql.connect(host='localhost', user='root', passwd='cyrushellborg666', db='brewing') cur = conn.cursor() cur.execute("SHOW TABLES") # print cur.description # r = cur.fetchall() # print r # ...or... for r in cur: print r cur.close() conn.close()
No comments:
Post a Comment