简体   繁体   中英

How can I dump mysql table in parts?

I have Linux server and a huge mysql table that I need to dump. The thing is, the sever is production and I don't want to crash it by dumping all at once. Also I intend to pipe it over ssh to another server. Because I don't want to fill up the disk space. I know about the mysqldump —where clause but I don't want to script those IDs. Is there any native functionality in mysql that allows dumping in parts? It doesn't have to be a mysqldump but it needs to be in parts so I don't crash the server and I'll need to pipe this over ssh.

Additional info: records are never updated in this table. They are only added

MySQL documentation: as outlined in their docs , mysqldump in not suited for large databases. They suggest to backup raw data files.

If your concern really is the load and not crashing the production, then maybe you should take a look at this post : How can I slow down a MySQL dump as to not affect current load on the server? about how to backup large production databases, using the right mysqldump args.

Slicing a production database may end up more dangerous in the end. Also I don't know how often entries get updated in the db, but slicing the export would give you an inconsistent dump regarding the data, having slices of the same table, from different times

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM