Advertisement
Guest User

Untitled

a guest
May 4th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. /* Total rows in a database */
  2. SELECT SUM(TABLE_ROWS)
  3. FROM INFORMATION_SCHEMA.TABLES
  4. WHERE TABLE_SCHEMA = '{your_db}';
  5.  
  6. /* Size of all databases in MB */
  7. SELECT table_schema "Data Base Name",
  8. sum( data_length + index_length ) / 1024 /
  9. 1024 "Data Base Size in MB",
  10. sum( data_free )/ 1024 / 1024 "Free Space in MB"
  11. FROM information_schema.TABLES
  12. GROUP BY table_schema ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement