I want to get the column names of a table, but there a over million data in it. So I cannot use:
cursor.execute(\"SELECT * FROM table_name\") print cursor.de
The correct way to do this would be to use "SHOW columns FROM table_name" however, you could also simply add a LIMIT to your existing query:
"SHOW columns FROM table_name"
LIMIT
cursor.execute("SELECT * FROM table_name LIMIT 0") print cursor.description