How to partition a table by timestamp, where data from every i'th day goes to partition i?
You can't use FROM_UNIXTIME() because hash partitions must be based on an integer expression.  But assuming your timestamp is stored as an integer, you can use DIV to return an integer.

Here's a demo of partitioning in the way you describe:

mysql&gt; create table table_to_partition (
  my_timestamp int unsigned primary key
) partition by hash(my_timestamp DIV (60*60*24)) partitions 3;

mysql&gt; insert into table_to_partition values (unix_timestamp(now()));
mysql&gt; insert into table_to_partition values (unix_timestamp(now()-interval 1 day));
mysql&gt; insert into table_to_partition values (unix_timestamp(now()-interval 2 day));
mysql&gt; insert into table_to_partition values (unix_timestamp(now()-interval 3 day));
mysql&gt; insert into table_to_partition values (unix_timestamp(now()-interval 4 day));
mysql&gt; insert into table_to_partition values (unix_timestamp(now()-interval 5 day));

mysql&gt; select table_name, partition_name, table_rows 
from information_schema.partitions where table_name='table_to_partition';

+--------------------+----------------+------------+
| table_name         | partition_name | table_rows |
+--------------------+----------------+------------+
| table_to_partition | p0             |          2 |
| table_to_partition | p1             |          2 |
| table_to_partition | p2             |          2 |
+--------------------+----------------+------------+