How to get the size of the MySQL database?

How to get the size of the MySQL database?


Published at - Aug 13, 2021

Run this query and you’ll probably get what you’re looking for:

SELECT table_schema "DB Name",
        ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" 
FROM information_schema.tables 
GROUP BY table_schema; 

This query comes from the MySQL forums, where there are more comprehensive instructions available.





Related Posts -

How do I import an SQL file using the command line in MySQL?
How do I import an SQL file ...

Try: mysql -u username -p database_name < file.sql Check MyS...



How do I quickly rename a MySQL database (change schema name)?
How do I quickly rename a M ...

For InnoDB, the following seems to work: create the new empty databas...



Follow Us

Follow us on facebook Click Here

Facebook QR
Scan from mobile
Join our telegram channel Click Here
Telegram QR
Scan from mobile