0

我在 mysql 数据库服务器上有 23 个表。我听说 db server 中的磁盘使用量很大(3GB),但是当我执行以下 sql 以查看占用最多空间的内容时,它看起来不像占用 3GB。

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 = "prod_schema";

有人知道为什么来自上述 sql 的数据与 db 中的实际空间使用情况不同吗?

或者是否有任何东西占用了数据库服务器中的空间?

我对数据库服务器的磁盘使用细节不太熟悉。

谢谢。

4

1 回答 1

0

If you are using MyIsam table engine, then this is the disk space you are using. BUT if you are using InnoDB then binlog and other log files might increase space utilization.

Plus if this "big disk usage (3GB)" was counted by simply looking at the total size of the MySQL library then this also includes the server exec files and different database log files.

于 2013-02-19T21:10:32.187 回答