mysql_database_sizes
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| mysql_database_sizes [2015/03/30 18:30] – luke7858 | mysql_database_sizes [2024/05/23 07:26] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | === File size of a specific db === | + | ~~NOCACHE~~ |
| - | __**Note: | + | ====== Database/ |
| - | <sxh bash> | + | {{tabembed>[[database_size|database size, [[table_size|table size}} |
| - | SELECT table_schema "Data Base Name", | + | |
| - | sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB", | ||
| - | |||
| - | sum( data_free )/ 1024 / 1024 "Free Space in MB" | ||
| - | |||
| - | FROM information_schema.TABLES | ||
| - | |||
| - | WHERE table_schema = " | ||
| - | </ | ||
| - | \\ | ||
| - | === Size of ALL databases === | ||
| - | |||
| - | __**Note: | ||
| - | |||
| - | <sxh bash> | ||
| - | SELECT table_schema " | ||
| - | |||
| - | sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB", | ||
| - | |||
| - | sum( data_free )/ 1024 / 1024 "Free Space in MB" | ||
| - | |||
| - | FROM information_schema.TABLES | ||
| - | |||
| - | GROUP BY table_schema ; | ||
| - | </ | ||
| - | \\ | ||
| - | === Size of a table in a db === | ||
| - | **__Note: | ||
| - | <sxh bash> | ||
| - | SELECT table_name AS " | ||
| - | |||
| - | | ||
| - | |||
| - | FROM information_schema.TABLES | ||
| - | |||
| - | WHERE table_schema = " | ||
| - | |||
| - | AND table_name = " | ||
| - | </ | ||
mysql_database_sizes.1427740213.txt.gz · Last modified: 2024/05/23 07:26 (external edit)
