- SELECT table_schema,
- ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB"
- FROM "DB Name" information_schema.TABLES
- GROUP BY table_schema;
- SELECT table_schema AS "Database", SUM(data_length + index_length) / 1024 / 1024 AS "Size (MB)" FROM information_schema.TABLES GROUP BY table_schema
Or
- SELECT table_schema AS "Database", SUM(data_length + index_length) / 1024 / 1024 / 1024 AS "Size (GB)" FROM information_schema.TABLES GROUP BY table_schema
to get size in GB.
You can however specify the database by replacing DB Name with the actual database if you want to check the size of a specific database.
Ref: DB Queries