MySQL Installation archive engine Update table engine

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.