MySQL Backup of table partioning

Hello All,

My Question is very simple.

I want to take the backup of mysql table who has partitioning, main issue is that I want to backup partition by partition say I have p0, p1 , p2 partition. I want take the backup of p0 only.

In RANGE partition it is very easy , but I want in hash partitioning and list partitioning.

Below is the example of RANGE partition :-
mysqldump --user=username --password=password --no-create-info --where=" YEAR(joined) < 1960" test members > test.members.p0.sql

But how to take backup of hash and list partition by partition.

Kindly help me out.

Thanks & Regards

Vaneet Gupta

This sql query should solve it for you.

It creates mysqldump commands with --where arguments that singles out data from each partition. I haven’t tested it myself though.