1. Install the Archive engine on the MySQL command line
1, find the MySQL plugins lib directory , See if there are Archive so in the directory ;
mysql > show variables like ' Plugin_dir ' ;
2, view the existing engine;
MySQL > Show engines;
3, install the Archive engine
M ysql> Install plugin archive soname ' ha_archive.so ' ;
4. View the installation results
M ysql> show engines;
2, updating the table engine
mysql > ALTER TABLE t_collection engine=archive;
mysql > ALTER TABLE Coocaadaohang engine=archive;
3, Create a new table logical partition;
The archive engine has a limit, the primary key cannot exceed 8byte, the partition has the limit must use the primary key to partition, therefore must retain the ID field, can only use the ID to Partition
CREATE TABLE ' t_collection ' (
' ID ' BIGINT () not NULL auto_increment COMMENT ' primary key ',
' Path ' TEXT COMMENT ' access paths ',
' Content ' TEXT COMMENT ' packet contents ',
' Createtime ' DATETIME not NULL COMMENT ' collection time ',
PRIMARY KEY (' ID ')
) engine= ARCHIVE DEFAULT Charset=utf8
PARTITION by RANGE (ID) (
PARTITION p0 VALUES less THAN (1000000000),
PARTITION p1 VALUES less THAN (2000000000),
PARTITION P2 VALUES less THAN (3000000000),
PARTITION P 3 VALUES less THAN (4000000000),
PARTITION P 4 VALUES less THAN (5000000000),
PARTITION P 5 VALUES less THAN (6000000000),
PARTITION P 6 VALUES less THAN (7000000000),
PARTITION P 7 VALUES less THAN (8000000000),
PARTITION P 8 VALUES less THAN (9000000000),
PARTITION P 9 VALUES less THAN MAXVALUE
);
)
This article is from the "My Operations Blog" blog, be sure to keep this source http://linuxpython.blog.51cto.com/10015972/1643940
MySQL Installation archive engine Update table engine