mysql -u root -p -e "SELECT table_name, ROUND((data_length + index_length) / 1024 / 1024, 2) AS size_mb FROM information_schema.tables WHERE table_schema = 'appdb' ORDER BY size_mb DESC;"

Category: Databases & SQL

mysql -u root -p -e "SELECT table_name, ROUND((data_length + index_length) / 1024 / 1024, 2) AS size_mb FROM information_schema.tables WHERE table_schema = 'appdb' ORDER BY size_mb DESC;"

Rank tables by size

Lists appdb's tables with their data plus index footprint, largest first. Spot the tables driving disk growth before deciding what to archive or partition.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.