Mysql – How to show the schema of a table in a MySQL database

databasedatabase-schemaMySQLschema

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

Best Answer

For formatted output:

describe [db_name.]table_name;

For an SQL statement that can be used to create a table:

show create table [db_name.]table_name;