查看数据库的大小

登录数据库服务器执行下面命令:

fsjshoes 代表数据库

SELECT
table_schema AS ‘数据库’,
SUM(table_rows) AS ‘记录数’,
SUM(TRUNCATE(data_length/1024/1024, 2)) AS ‘数据容量(MB)’,
SUM(TRUNCATE(index_length/1024/1024, 2)) AS ‘索引容量(MB)’
FROM information_schema.tables
WHERE table_schema=’fsjshoes’;

Leave a comment

您的邮箱地址不会被公开。 必填项已用 * 标注