mysqldump partial database

与世无争的帅哥 提交于 2019-12-04 10:02:08

Add this --where="id>2500000" at the end of mysqldump command. MySQL 5.1 Reference Manual

In your case the mysqldump command would look like

mysqldump --host=ipaddress \
    --user=username \
    --password=password \
    db_name table_name \
    --where="id>2500000

If you dump twice. The second dump will contain table creation info. But next time you want to add the new rows only. So for second dump add --no-create-info option in mysqldump command line.

I've developed a tool for this job. It's called mysqlsuperdump and can be found here:

https://github.com/hgfischer/mysqlsuperdump

With it you can speciffy the full "WHERE" clause for each table, so it's possible to specify different rules for each table.

You can also replace the values of each column by each table in the dump. This is useful, for example, when you want to export a database dump to use in development environment.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!