Calculate mySQL database size in gigabytes

mysql

SELECT table_schema “db_name_here”, sum(data_length + index_length)/1024/1024/1024 “size in GB” FROM information_schema.TABLES GROUP BY table_schema;

Leave a Reply

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