Each mysql query tables space size

Query: database replace their database name

SELECT
TABLE_SCHEMA AS 'database',
table_name AS 'table',
table_rows AS 'number of records',
TRUNCATE (the data_length / 1024/1024, 2) AS 'data capacity (MB)',
TRUNCATE (Index_length / 1024/1024, 2) as 'index capacity (MB)'
from information_schema.tables
WHERE TABLE_SCHEMA = 'Database'
Order desc by the data_length, Index_length desc;





sql accessories  https://www.cnop.net/uploadfile/2020/0311/20200311030641987.zip


Guess you like

Origin blog.51cto.com/sjby365/2477302