mysqldatabase-schemadatabase-metadata

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


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


Solution

  • select column_name from information_schema.columns
    where table_schema = 'your_db'
    order by table_name,ordinal_position