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;
The first command you will need to use is the SELECT FROM MySQL statement that has the following syntax: SELECT * FROM table_name; This is a basic MySQL query which will tell the script to select all the records from the table_name table.
To check the sizes of all of your databases, at the mysql> prompt type the following command: Copy SELECT table_schema AS "Database", ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)" FROM information_schema.
Show MySQL Tables from the Command Line To get information about the tables from the Linux shell, you can use either the mysql -e command or the mysqlshow command that displays databases and tables information.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With