How to get database structure in MySQL via query

Jakub Arnold picture Jakub Arnold · May 22, 2009 · Viewed 344.1k times · Source

Is it possible to somehow get structure of MySQL database, or just some table with simple query?

Or is there another way, how can I do it?

Answer

Bill the Lizard picture Bill the Lizard · May 22, 2009

I think that what you're after is DESCRIBE

DESCRIBE table;

You can also use SHOW TABLES

SHOW TABLES;

to get a list of the tables in your database.