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.



About author

Harendra
Harendra Kanojiya

Hi I'm Harendra Kumar Kanojiya. Currently I am FSD (Full-stack developer) and I have expertise with Angular ,PHP, Node JS, Laravel, Codeigniter and front end. Done few live projects and portfolio work in above.



Related Posts -

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...



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...



Follow Us

Follow us on facebook Click Here

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