mysql> show variables like 'version%';
+-------------------------+---------------------+
| Variable_name           | Value               |
+-------------------------+---------------------+
| version                 | 5.1.51              |
+-------------------------+---------------------+CREATE TABLE employees (  
    id INT NOT NULL,  
    fname VARCHAR(30),  
    lname VARCHAR(30),  
    hired DATE NOT NULL DEFAULT '1970-01-01',  
    separated DATE NOT NULL DEFAULT '9999-12-31',  
    job_code INT,  
    store_id INT  
)  
  
PARTITION BY LIST(store_id)  
    PARTITION pNorth VALUES IN (3,5,6,9,17),  
    PARTITION pEast VALUES IN (1,2,10,11,19,20),  
    PARTITION pWest VALUES IN (4,12,13,14,18),  
    PARTITION pCentral VALUES IN (7,8,15,16)  
);
创建分区表却报错:
ERROR 1289 (HY000): The 'partitioning' feature is disabled; you need MySQL built with '--with-partition' to have it working查看 mysql> show variables like 'have_partitioning';;
+-------------------+-------+
| Variable_name     | Value |
+-------------------+-------+
| have_partitioning | NO    |
+-------------------+-------+
1 row in set (0.00 sec)
也不支持分区的啊
在http://topic.csdn.net/u/20090104/11/12988f83-c9e4-4967-9e58-51aee0b9ebe2.html
这贴中看到大家讲mysql5.1以上的版本都支持mysql分区表功能 查看官网http://dev.mysql.com/doc/refman/5.1/zh/partitioning.html#partitioning-overview当二进制码变成可用时(也就是说,5.1 -max 二进制码将通过--with-partition 建立),分区支持就将包含在MySQL 5.1的-max 版本中。如果MySQL二进制码是使用分区支持建立的,那么激活它不需要任何其他的东西 (例如,在my.cnf 文件中,不需要特殊的条目)。
请教大家 
这是版本的问题 还是其他问题?

解决方案 »

  1.   

    直接下载那个WINODWS安装的版本。
      

  2.   

    mysql5.0以后的版本都支持分区的。
      

  3.   


    恩 我测试windows版本的mysql没有问题 
    linux下的mysql虽然是5.1.51 但编译的时候 没有加partition参数 不能用
    后来我重新编译了下--with-plugins=partition 就可以了不过我看官网上的编译参数里面有--with-plugins=max 我用这个参数编译完 启动mysql就会卡死 但是mysql却能运行
    121010 11:12:37 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
    121010 11:12:37  InnoDB: Started; log sequence number 0 1965194
    121010 11:12:37 [Note] Event Scheduler: Loaded 0 events
    121010 11:12:37 [Note] /usr/local/mysql/libexec/mysqld: ready for connections.
    Version: '5.1.51'  socket: '/tmp/mysql.sock'  port: 3306  Source distributionStatus information:Current dir: /usr/local/mysql/var/
    Running threads: 0  Stack size: 196608
    Current locks:
    lock: 0x88d660c:lock: 0x88c15fc:lock: 0x88b7d44:lock: 0x88afdac:lock: 0x88a4ddc:lock: 0x889a064:lock: 0x8889474:lock: 0x888335c:
    Key caches:
    default
    Buffer_size:       8384512
    Block_size:           1024
    Division_limit:        100
    Age_limit:             300
    blocks used:             3
    not flushed:             0
    w_requests:              0writes:                  0
    r_requests:              6
    reads:                   3
    handler status:
    read_key:            0
    read_next:           1
    read_rnd             0
    read_first:          3
    write:               0
    delete               0
    update:              0Table status:
    Opened tables:         15
    Open tables:            8
    Open files:            21
    Open streams:           0Alarm status:
    Active alarms:   0
    Max used alarms: 0
    Next alarm time: 0Begin safemalloc memory dump:End safemalloc memory dump.Memory status:
    Non-mmapped space allocated from system: 4313088
    Number of free chunks:                   10
    Number of fastbin blocks:                0
    Number of mmapped regions:               10
    Space in mmapped regions:                22106112
    Maximum total allocated space:           0
    Space available in freed fastbin blocks: 0
    Number of fastbin blocks:                0
    Number of mmapped regions:               10
    Space in mmapped regions:                22106112
    Maximum total allocated space:           0
    Space available in freed fastbin blocks: 0
    Total allocated space:                   4208128
    Total free space:                        104960
    Top-most, releasable space:              87376
    Estimated memory (with thread stack):    26419200Events status:
    LLA = Last Locked At  LUA = Last Unlocked At
    WOC = Waiting On Condition  DL = Data LockedEvent scheduler status:
    State      : INITIALIZED
    Thread id  : 0
    LLA        : n/a:0
    LUA        : n/a:0
    WOC        : NO
    Workers    : 0
    Executed   : 0
    Data locked: NOEvent queue status:
    Element count   : 0
    Data locked     : NO
    Attempting lock : NO
    LLA             : init_queue:132
    LUA             : init_queue:142
    WOC             : NO
    Next activation : never
    高手们看看这是怎么回事?