Check database tables size in Mb

Description:

How can I check the size of my database tables and receive a human readaable result? This can be useful when deciding a storage architecture or a Cloud storage plan.

Solution:

From command line, go to mysql> terminal:

SELECT table_name AS “Table”, ROUND(((data_length + index_length) / 1024 / 1024), 2) AS “Size (MB)” FROM information_schema.TABLES WHERE table_schema = “database_name” ORDER BY (data_length + index_length) DESC;

Advertisements

About admin

Just another php developer trying to give something back to the community.
This entry was posted in SQL and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s