troubleshooting Question

MySQL partitioning trouble

Avatar of MFredin
MFredinFlag for United States of America asked on
MySQL Server
8 Comments2 Solutions721 ViewsLast Modified:
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
ASKER CERTIFIED SOLUTION
rubene

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros