Mysql

Mysql

查看数据库大小 refer official documentation DATA_LENGTH is the length (or size) of all data in the table (in bytes). INDEX_LENGTH is the length (or size) of the index file for the table (also in bytes). SELECT table_schema AS "Database", ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)" FROM information_schema.TABLES GROUP BY table_schema; # 返回结果类似—— Database