ERROR 1289 (HY000): The 'partitioning' feature is disabled; you need MySQL built with '--with-plugin

本文详细介绍了如何解决MySQL中partitioning功能不可用的问题,包括重新编译MySQL以启用partitioning功能,以及如何通过my.cnf配置文件进行设置。同时,提供了查看partitioning状态的方法,并解释了partitioning功能为何不能通过动态配置改变。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

解决方案:

 

      

  partitioning 不可用,需要重新编译MySQL,添加'--with-partition'。(其实就是./configure --prefix=**  --with-partition)来让它工作。

在my.cnf w ith-partition / have-partitioning=YES /  或者其它的组合但是失败了,它不是一个动态配置项,而是要你按照这种模式重新编译MySQL后才可以开启这个功能。

 

查看参数:

 

[root@SR3 etc]# /opt/mysql/bin/mysql  -h10.86.87.155 -uroot  -pinfohow
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.5.16-log Source distribution

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show variables like 'have_partitioning';
+-------------------+-------+
| Variable_name     | Value |
+-------------------+-------+
| have_partitioning | NO    |
+-------------------+-------+
1 row in set (0.00 sec)

 

 

 

 

 

 

这个错误信息 "1479 - Syntax error: RANGE PARTITIONING requires definition of VALUES LESS THAN for each partition" 通常出现在使用MySQL数据库进行表分区操作时。具体来说,这个错误表明在使用范围分区(RANGE PARTITIONING)时,没有为每个分区定义 `VALUES LESS THAN` 子句。 在MySQL中,范围分区是一种常见的分区方法,它根据某个列的值范围将数据分配到不同的分区。要使用范围分区,必须为每个分区指定一个上限值(使用 `VALUES LESS THAN`),这样MySQL才能知道如何将数据分配到不同的分区。 以下是一个正确使用范围分区的例子: ```sql CREATE TABLE employees ( id INT NOT NULL, fname DECIMAL(14,2), lname VARCHAR(30), hired DATE NOT NULL DEFAULT '1970-01-01', separated DATE NOT NULL DEFAULT '9999-12-31', job_code INT NOT NULL, store_id INT NOT NULL ) PARTITION BY RANGE (store_id) ( PARTITION p0 VALUES LESS THAN (10), PARTITION p1 VALUES LESS THAN (20), PARTITION p2 VALUES LESS THAN (30), PARTITION p3 VALUES LESS THAN (40), PARTITION p4 VALUES LESS THAN MAXVALUE ); ``` 在这个例子中,我们创建了一个名为 `employees` 的表,并根据 `store_id` 列进行范围分区。我们为每个分区都定义了 `VALUES LESS THAN` 子句,最后一个分区使用 `MAXVALUE` 来表示所有大于等于40的值。 要解决这个问题,你需要为每个分区都添加一个 `VALUES LESS THAN` 子句,确保所有可能的值范围都被覆盖。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值