MySQL 5.5 creates a linear Hash Partition Table and distributes the table files to different physical disks.

Source: Internet
Author: User

MySQL 5.5 creates a linear Hash Partition Table and distributes the table files to different physical disks. Data on different servers must be merged. Considering that the game zone group server will be added continuously in the future, therefore, use the linear hash partition of mysql5.5. When the added Block Partition exceeds the hash partition, add the partition again. When the maintenance is stopped, distribute the newly added Partition Table files to other physical partitions. under www.2cto.com, the SQL DROP TABLE IF EXISTS gyyx_middle is created. 'wd _ char_info '; tudou @ GyyxCREATE TABLE gyyx_middle. 'wd _ char_info '('dist' int (11) not null default '0', 'account' varchar (32) not null default 'Player account ', 'name' varchar (32) not null default '', 'create _ d Ate 'int (11) not null default '0', 'create _ time' datetime not null default '2017-00-00 00:00:00 ', 'First _ login_ip' INT (11) not null default 0, 'gender' tinyint (11) not null default '0', 'last _ login_date 'INT (11) not null default '0 ', 'Last _ login_time 'datetime not null default '2017-00-00 00:00:00', 'last _ login_ip 'int (11) not null default 0, 'Glory' int (11) not null default '0', 'level' mediumint (11) not null default '0', 'Tao' int (11) not null default '0', 'cash' int (11) not null default '0 ', 'Nice 'int (11) not null default '0', 'reputation' int (11) not null default '0 ') ENGINE = MyISAM default charset = latin1PARTITION by linear hash ('dist') PARTITIONS 500; distribute the table files with an even number of partition files to another physical partition www.2cto.com #! /Bin/shFILEDIR = "/data/mysql5_5_20/data/gyyx_middle/" MVDIR = "/data1/mysql5_5_20/data/gyyx_middle/" for I in 'seq 0 249 'doi = $ [I * 2] mv $ {FILEDIR} "wd_char_info # P # p" $ {I }". MYI "$ {MVDIR}" wd_char_info # P # p "$ {I }". MYI "mv $ {FILEDIR}" wd_char_info # P # p "$ {I }". MYD "$ {MVDIR}" wd_char_info # P # p "$ {I }". MYD "done creates a soft link in the original directory #! /Bin/shFILEDIR = "/data1/mysql5_5_20/data/gyyx_middle/" LNDIR = "/data/mysql5_5_20/data/gyyx_middle/" FILELIST = 'ls $ filedir' for FILENAME $ FILELISTdoln-s $ {FILEDIR }$ {FILENAME }$ {LNDIR }$ {FILENAME} done

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.