日期:2014-05-16  浏览次数:20782 次

支持mysql分区表的版本
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 文件中,不需要特殊的条目)。
请教大家 
这是版本的问题 还是其他问题?

------解决方案--------------------
版本没有问题,只是安装的时候需要制定参数。
------解决方案--------------------
楼主版本没有问题。分区参数问题。
------解决方案--------------------
If you are compiling MySQL 5.1 from source, the build must be configured using --with-partition to enable partitioning. Using --with-plugins=max to configure the build includes this option automatically.