Howto get the total size of each database in MySQL/MariaDB

SELECT table_schema AS "Database", 
ROUND(SUM(data_length+index_length)/1024/1024,2) AS "Size (MB)" 
FROM information_schema.TABLES 
GROUP BY table_schema;

From: https://www.a2hosting.com/kb/developer-corner/mysql/determining-the-size-of-mysql-databases-and-tables

Tags: ,

Reply

Your email address will not be published.