Skip to content

How to Obtain the Size of the MySQL Managed Database⚓︎

Summary⚓︎

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 = doadmin
password = ****************
host = db-mysql-nyc1-79999-do-user-6634872-0.a.db.ondigitalocean.com
port = 25060
database = defaultdb
sslmode = REQUIRED
  • Open the SQL Query section.
  • Run the following query, which should return the output below:
SELECT table_schema "db-mysql-nyc1-79999",
        ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" 
FROM information_schema.tables 
GROUP BY table_schema;
db-mysql-nyc1-79999 DB Size in MB
bookstack 21.6
defaultdb 18.6
ghost_production 1.8
information_schema 0.0
mysql 7.8
performance_schema 0.0
sys 0.0

Resources⚓︎

https://stackoverflow.com/a/1733523