myisam的表已经分了区,当我试图将其改为innodb时出现如下错误:CREATE TABLE ti (id INT, amount DECIMAL(7,2), tr_date DATE)     ENGINE=MYISAM     PARTITION BY HASH(MONTH(tr_date))     PARTITIONS 6; ALTER TABLE ti ENGINE=INNODB;
ERROR 1497 (HY000): The mix of handlers in the partitions is not allowed in this version of MySQL这说明这是不可能完成的任务还是我的alter操作的不对?

解决方案 »

  1.   

    没有你说的问题啊。mysql> CREATE TABLE ti (id INT, amount DECIMAL(7,2), tr_date DATE)   ENGINE=MYIS
    AM   PARTITION BY HASH(MONTH(tr_date))   PARTITIONS 6;
    Query OK, 0 rows affected (0.06 sec)mysql> ALTER TABLE ti ENGINE=INNODB;
    Query OK, 0 rows affected (0.27 sec)
    Records: 0  Duplicates: 0  Warnings: 0mysql> select version();
    +----------------------+
    | version()            |
    +----------------------+
    | 5.1.33-community-log |
    +----------------------+
    1 row in set (0.00 sec)mysql>
      

  2.   

    理论上可以的。“The mix of handlers in the partitions is not allowed in this version of MySQL”
    你看看你mysql版本,估计你的版本问题
      

  3.   

    果然!
    mysql> SELECT VERSION();
    +----------------+
    | VERSION()      |
    +----------------+
    | 5.4.1-beta-log | 
    +----------------+
    1 row in set (0.00 sec)用的是5.4
      

  4.   

    明天再换成5.1的,打算将sphinx编译进去!
      

  5.   

    不对啊,我在另一台服务器上运行的也出现这个错误:
    ERROR 1497 (HY000): The mix of handlers in the partitions is not allowed in this version of MySQL版本是5.1mysql> SELECT VERSION();
    +------------+
    | VERSION()  |
    +------------+
    | 5.1.37-log | 
    +------------+
    1 row in set (0.00 sec)
    难道是我编译的时候没有加上innodb的选项?mysql> SHOW ENGINES;
    +------------+---------+-----------------------------------------------------------+--------------+------+------------+
    | Engine     | Support | Comment                                                   | Transactions | XA   | Savepoints |
    +------------+---------+-----------------------------------------------------------+--------------+------+------------+
    | MRG_MYISAM | YES     | Collection of identical MyISAM tables                     | NO           | NO   | NO         | 
    | CSV        | YES     | CSV storage engine                                        | NO           | NO   | NO         | 
    | MEMORY     | YES     | Hash based, stored in memory, useful for temporary tables | NO           | NO   | NO         | 
    | MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great performance    | NO           | NO   | NO         | 
    +------------+---------+-----------------------------------------------------------+--------------+------+------------+
    4 rows in set (0.00 sec)列表没有innodb,但是确实也让建立innodb的数据表!