We help IT Professionals succeed at work.
Get Started

MySQL partitioning trouble

MFredin
MFredin asked
on
718 Views
Last Modified: 2012-05-11
I'm trying to partition a MySQL 5.5 MyISAM table but getting an error.  Partitioning by state.  phy_st (varchar) is a column mytable and the values are the state abbreviations.  From what I've read, this should work.  What am I missing here?

ALTER TABLE mytable
PARTITION BY LIST COLUMN(phy_st)
    PARTITION p1 VALUES IN('NY','FL','GA'),
    PARTITION p2 VALUES IN('TX','MI','CA'),
    PARTITION p3 VALUES IN('MN','IN','IL'),    
    PARTITION p4 VALUES IN('WI','NJ','AL'),
    PARTITION p5 VALUES IN('OH','KY','NC'),
    PARTITION p6 VALUES IN('MD','TN','CO'),    
    PARTITION p7 VALUES IN('MO','IA','NE'),
    PARTITION p8 VALUES IN('MA','OK','OR'),
    PARTITION p9 VALUES IN('VA','SC','AZ'),    
    PARTITION p10 VALUES IN('PA','WA','UT'),    
    PARTITION p11 VALUES IN('LA','KS','MS'),
    PARTITION p12 VALUES IN('WV','AR','CT'),
    PARTITION p13 VALUES IN('ME','ID','NM'),    
    PARTITION p14 VALUES IN('ON','NH','MT'),
    PARTITION p15 VALUES IN('SD','RI','WY'),
    PARTITION p16 VALUES IN('QC','NV','ND'),
    PARTITION p17 VALUES IN('DE','BN','VT'),  
    PARTITION p18 VALUES IN('TA','BC','AB'),
    PARTITION p19 VALUES IN('CI','MB','NB'),
    PARTITION p20 VALUES IN('NL','SK','SO'),    
    PARTITION p21 VALUES IN('DC','SI','CH'),
    PARTITION p22 VALUES IN('MX','NS','JA'),
    PARTITION p23 VALUES IN('GJ','BS','DF'),    
    PARTITION p24 VALUES IN('MC','VC','DG'),
    PARTITION p25 VALUES IN('PE','SL','AG'),
    PARTITION p26 VALUES IN('YT','QE','HD','PU','TL'),    
    PARTITION p27 VALUES IN('ZA','CL','GU','CP','MR','NA'),
    PARTITION p28 VALUES IN('MP','TB','AS','OA','GE','CS','YU','NT','QI')
);


Error:

[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COLUMN(phy_st)

    PARTITION p1 VALUES IN('NY','FL','GA'),
    PARTITION p2 ' at line 2
Comment
Watch Question
Commented:
This problem has been solved!
Unlock 2 Answers and 8 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE