连接数据库 db = pymysql.connect(host='', user='', passwd='',db='', port=, charset='utf8')
c = db.cursor()
查询表spider中的字段信息 c.execute("select column_name, column_comment, column_type, data_type, is_nullable, column_default from information_schema.columns where table_name = 'spider'") print(c.fetchall())
查询字段全部信息 c.execute('show columns from spider') print(c.fetchall())