Linux 4 All

Best Linux tricks source

Get a MySQL database size

It’s pretty easy to get a MySQL database size. All you need to do is running the following MySQL command:

SELECT CONCAT(sum(ROUND(((DATA_LENGTH + INDEX_LENGTH - DATA_FREE) / 1024 / 1024),2))," MB") AS Size FROM INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA like '%DB_NAMES%';

Try to replace DB_NAMES with actual Database name to get some values.

Fastest way to clear a folder with huge number of files arrow-right
Next post

Leave a Reply

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