SQL script: get database or table size
suma total del peso de toda la BD, este valor es aproximado si hablamos de innoBD
note: change "NOMBREBD" your BD name
SELECT SUM(ROUND(((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024),2)) "Size in MB"
FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = "NOMBREBD";
muestra el tamaño por tabla dentro de la BD seleccionada, este valor es aproximado si hablamos de innoBD
note: change "NOMBREBD" your BD name
SELECT TABLE_NAME, table_rows, data_length, index_length,
round(((data_length + index_length) / 1024 / 1024),2) "Size in MB"
FROM information_schema.TABLES WHERE table_schema = "NOMBREBD";
Written by Oliver Montes
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Mysql
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#