MySQL – How to Specify Partition in mysqldump Command

MySQLmysql-5.6mysqldump

I have to export some data from a table which is partitioned, and with some extra condition
So I use mysqldump command,and use --where"xxxxxx" options as below

mysqldump -hxxx -Pxxx -uxxx xxx rtm --tables xxx --where="xxx"> xxx

But how can I specify partition (partx) keyword in mysqldump command,since I just need the data from the specific partition.

Best Answer

Plan A: Provide a WHERE clause that exactly covers that partition.

Plan B: Let's discuss (1) why you are using partitioning, and (2) why you need that kind of dump.

Plan C: See "transportable tablespaces" as a way to break off a partition, turning it into an independent table.