Get size of database in bytes and rows

How to get the size of the database in MySQL?

Replace database_name with the database name from which you want the size in bytes and rows:

SELECT t.table_schema,SUM(t.table_rows) AS row_count,SUM(t.data_length) AS data_volume
FROM information_schema.tables t
WHERE table_schema ='database_name'
GROUP BY t.table_schema

comments powered by Disqus