How do I show the schema of a table in a MySQL database?

dlamblin picture dlamblin · Sep 30, 2009 · Viewed 486k times · Source

From the MySQL console, what command displays the schema of any given table?

Answer

Omry Yadan picture Omry Yadan · Sep 30, 2009
describe [db_name.]table_name;

for formatted output, or

show create table [db_name.]table_name;

for the SQL statement that can be used to create a table.