Snippets - MySQL

Database Size in MySQL

|
Anuz Pandey

In this snippet, we will learn how to get the total size of a database in MySQL using a simple select query statement.

Use the following query to get the total size of a database in MySQL. Please update the database_name with your actual database name.

Output:

The result is in megabytes (MB).

Getting the total size of all databases in MySQL

Output:

The results are in gigabytes (GB).

Keep coding, keep exploring and inspiring. 🐼


  • Tags:
  • mysql
  • database-size
  • query