查询一个数据库中所有的表名和字段名

connection = pymysql.connect(host = '139.******',
                            port = 3918,
                            user = 'admin',
                            password = '**********',
                            db = 'information_schema',
                            charset='GBK',
                            cursorclass=pymysql.cursors.DictCursor)
cur=connection.cursor()

 

table = pd.read_sql_query("SELECT * from information_schema.`COLUMNS` where  TABLE_SCHEMA = '**l'",con=connection)

posted @ 2017-07-21 17:43  Aogon  阅读(203)  评论(0)    收藏  举报