I want to get the column names of the table, but there are more than a million data. Therefore, I can not use:
cursor.execute("SELECT * FROM table_name") print cursor.description
And in sqlite3 I do it like this
crs.execute("PRAGMA table_info(%s)" %(tablename[0])) for info in crs: print info
But this does not work in python mysqldb. Does anyone know how to do this?
python mysql mysql-python
Macshanhe
source share