« Office: check if PowerPoint is running | Home | Oracle: source text for the view, package etc »

mySQL: size of the database

SELECT table_schema "Database",
 sum( data_length + index_length ) / 1024 / 1024 "Size (MB)",
 sum( data_free )/ 1024 / 1024 "Free (MB)"
FROM information_schema.TABLES
GROUP BY table_schema ;

This will work in mySQL 5.0.2 and newer. Use SHOW TABLE STATUS command for other versions.

Topics: MySQL, database, size, space | Submitter: checkthis

Comments

You must be logged in to post a comment.

Keep on coding