All HowTo's MySQL & MariaDB

Get the size of MySQL databases

This is a one-liner that will show you the size of your MySQL databases. This works for RDS MySQL databases. Having logged into your MySQL server as the root user:

SELECT table_schema "Database Name", sum( data_length + index_length ) / 1024 / 1024 "Database Size in MB"  FROM information_schema.TABLES GROUP BY table_schema ;

This one-liner was found on a google forum. I take no credit for it.

Leave a Reply

Your email address will not be published. Required fields are marked *