Find Database Size on MySQL

Determine MySQL Database Size

Determining the size of MySQL database

Determining the size of specific MySQL database can be done in so many way, you can do it from the Linux file system perspective or from MySQL.

The most accurate way to find MySQL database size recommended by Percona is by checking the information_schema and this can be done by running the following query (Replace db_name with the database name you want to investigate) :

Database size in GB:

SELECT table_schema "Database Name", SUM( data_length + index_length)/1024/1024/1024 "Database Size (GB)" FROM information_schema.TABLES where table_schema = 'db_name';

Database size in MB:

SELECT table_schema "Database Name", SUM( data_length + index_length)/1024/1024 "Database Size (MB)" FROM information_schema.TABLES where table_schema = 'db_name';

 


Subscribe to
for video tutorials updates