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 [2017/02/23 08:47] – luke7858 | mysql_database_sizes [2024/05/23 07:26] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ~~NOCACHE~~ | ~~NOCACHE~~ | ||
| - | ====== | + | ====== |
| - | {{tabembed> | + | {{tabembed> |
| - | ==== 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 ; | ||
| - | </ | ||
| - | \\ | ||
| - | ==== File size of a specific db ==== | ||
| - | The following commands should be run inside mysql | ||
| - | \\ | ||
| - | __**Note: | ||
| - | <sxh bash> | ||
| - | 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 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.1487839668.txt.gz · Last modified: 2024/05/23 07:26 (external edit)
