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