ThinkCode
ThinkCode

Reputation: 7961

How to display all the tables with more information (create date, size,...) in a MySQL database?

Searched and searched and gave up. All I want is more info on a MySQL table or better yet, a list of all tables in a MySQL database in the descending/ascending order of their create date.

Something like this :

SHOW TABLES FROM MyDB ORDER BY CREATE_DATE;

Donnie's answer did the trick :

select * from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA = 'DBName' order by create_time desc;

Upvotes: 13

Views: 12301

Answers (1)

Donnie
Donnie

Reputation: 46913

INFORMATION_SCHEMA.TABLES is the most easily queryable, but that doesn't have creation date. show table status does return creation date information. You can probably craft something to get the table name out of information_schema, then call show table status on each.

Upvotes: 11

Related Questions