在转储之前如何确定转储文件的大小?


Answers:


28

请运行以下查询:

SELECT
    Data_BB / POWER(1024,1) Data_KB,
    Data_BB / POWER(1024,2) Data_MB,
    Data_BB / POWER(1024,3) Data_GB
FROM (SELECT SUM(data_length) Data_BB FROM information_schema.tables
WHERE table_schema NOT IN ('information_schema','performance_schema','mysql')) A;

这会给你一个大概的数字。index_length不使用该列,因为mysqldump不转储索引,仅转储数据。为了安全起见,您应该始终立即对其进行gzip压缩:

mysqldump --all-databases --routines --triggers | gzip > MySQLData.sql.gz

试试看 !!!

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.