<< Back

Get Mysql Database Size

Posted on Tuesday 30th June 2020

Get Size in GB

SELECT 
  table_schema AS "Database", 
  SUM(data_length + index_length) / 1024 / 1024 / 1024 AS "Size (GB)" 
FROM information_schema.TABLES GROUP BY table_schema

Get size in MB

SELECT 
  table_schema AS "Database", 
  SUM(data_length + index_length) / 1024 / 1024 AS "Size (MB)" 
FROM information_schema.TABLES GROUP BY table_schema