0

Is it possible to list all tables in a given MySQL database with the modification date in the right side?

I am looking for something like

SHOW TABLES FROM MY_DATABASE;
DanielTheRocketMan
  • 3,199
  • 5
  • 36
  • 65

1 Answers1

0

You can query the tables with information_schema.tables

select table_name, 
       coalesce(update_time, create_time) as last_modified
from information_schema.tables
juergen d
  • 201,996
  • 37
  • 293
  • 362
  • Only for MyISAM, though – Sergio Tulentsev Jan 26 '15 at 13:11
  • @SergioTulentsev Care to elaborate? – Strawberry Jan 26 '15 at 13:13
  • @Strawberry: AFAIK, these columns (create_time/update_time) are mapped directly to file attributes on table data files. Since innodb by default stores all tables in one big file, I can't imagine how it would work. Even with file-per-table mode, those dates are not very reliable. – Sergio Tulentsev Jan 26 '15 at 13:18
  • @juergen_d This new column presents some dates, but it seems to not correspond the last modification dates. I have just modified a table in my database inserting a new element and the date that arises in the right side is about a week ago. – DanielTheRocketMan Jan 26 '15 at 13:22
  • @SergioTulentsev I see (well, I think I do). Thanks for the explanation. – Strawberry Jan 26 '15 at 14:54