How to get all columns' names for all the tables in MySQL?

dieter picture dieter · Apr 13, 2011 · Viewed 185.5k times · Source

Is there a fast way of getting all column names from all tables in MySQL, without having to list all the tables?

Answer

Nicola Cossu picture Nicola Cossu · Apr 13, 2011
select * from information_schema.columns
where table_schema = 'your_db'
order by table_name,ordinal_position