How to Obtain the Size of the MySQL Managed Database

This article will list the steps involved in obtaining the size of the MySQL Managed database on DigitalOcean.

Tip

The query listed below will be done on a Mac using TablePlus, but can be done in any application that makes use of SQL queries.

How-To

  • Open TablePlus and connect to the database.
username = <user>
password = ****************
host = <cluster-host>
port = <port>
database = defaultdb
sslmode = REQUIRED
  • Open the SQL Query section.
  • Run the following query, which should return the output below:
SELECT table_schema "Database",
        ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" 
FROM information_schema.tables 
GROUP BY table_schema;
DatabaseDB Size in MB
bookstack21.6
defaultdb18.6
ghost_production1.8
information_schema0.0
mysql7.8
performance_schema0.0
sys0.0

Resources

https://stackoverflow.com/a/1733523

← All notes