MySQL dump of large database appears to be less than original MySQL database itself

StackOverflow https://stackoverflow.com/questions/23577137

  •  19-07-2023
  •  | 
  •  

문제

I am backing up a database whose size is about 190 GB. I want to back up the database to a local file. This is the command I am using:

mysqldump -u root -p tradeData > /db_backup/tradeData.sql

I have enough space on my machine. I tried a bunch of times and got no errors, but I am always getting a result file whose size is around 122GB.

Does anyone have experience with backing up large databases? My machine is a Linux one.

도움이 되었습니까?

해결책

Using information like the SQL query here won’t give you a one-to-one connection between your local DB dump and what is actually in the system. Actual DBs have indexes and data that only exist when the DB is actually a DB in the database. As RolandoMySQLDBA explains:

From the dump file size, it is hard to judge because the combined total size of data pages and index pages maybe far less that the size of ibdata1 the dump was created from.

So my guess is your database includes InnoDB tables among other things that bloat the DB when compared to a bare dump.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top