Difference between revisions of "Find the size of mysql database"
From MyWiki
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
'''If you run the query which is given below in MySQL Query Browser then you will get the two columns first will display the Data Base Name and the second will display the Data Base Size in MB.''' <br> | '''If you run the query which is given below in MySQL Query Browser then you will get the two columns first will display the Data Base Name and the second will display the Data Base Size in MB.''' <br> | ||
SELECT table_schema "Data Base Name", sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB" | SELECT table_schema "Data Base Name", sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB" | ||
− | FROM information_schema.TABLES GROUP BY table_schema ; <br> | + | FROM information_schema.TABLES GROUP BY table_schema ; <br><br> |
+ | '''If you have question in your mind like "How to view the Free space available for my Data Base in MySQL", then run the below query:''' | ||
+ | |||
+ | 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 | ||
+ | GROUP BY table_schema ; |
Latest revision as of 08:15, 14 September 2015
If you run the query which is given below in MySQL Query Browser then you will get the two columns first will display the Data Base Name and the second will display the Data Base Size in MB.
SELECT table_schema "Data Base Name", sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB"
FROM information_schema.TABLES GROUP BY table_schema ;
If you have question in your mind like "How to view the Free space available for my Data Base in MySQL", then run the below query:
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 GROUP BY table_schema ;