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?
select * from information_schema.columns
where table_schema = 'your_db'
order by table_name,ordinal_position
To list all the fields from a table in MySQL:
select *
from information_schema.columns
where table_schema = 'your_DB_name'
and table_name = 'Your_tablename'
it is better that you use the following query to get all column names easily
Show columns from tablename