在MySQL中,创建带分区的表一切正常,如下:
create table t1 (
id int,
year_col int
)
partition by range (year_col) (
partition p0 values less than (1991),
partition p0 values less than (1995),
partition p0 values less than (1999)
);
但是创建完成之后,再想新增加一个分区p3,如下:
alter table t1 add partition p3 values less than (2002);
就会报如下错误:
ERROR 1064 (42000): 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 'p3 values less than (2002)' at line 1
这个例子是MySQL官网上的,请明白的人帮忙解决下这个问题。
create table t1 (
id int,
year_col int
)
partition by range (year_col) (
partition p0 values less than (1991),
partition p0 values less than (1995),
partition p0 values less than (1999)
);
但是创建完成之后,再想新增加一个分区p3,如下:
alter table t1 add partition p3 values less than (2002);
就会报如下错误:
ERROR 1064 (42000): 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 'p3 values less than (2002)' at line 1
这个例子是MySQL官网上的,请明白的人帮忙解决下这个问题。
解决方案 »
- mysql 集群 提问
- 如何将mysql无限级树结构转换为平面列表
- 为什么给一个字段建立索引必须要指定这个字段为Not NULL???
- 眼珠子都快看出来了,都没看出错在哪?关于mysql插入
- MySQL表中,Datetime的Default Value如何是当前Insert的时间?
- mysql-connector-c++ 执行execute之后连接会关闭
- 业务库是mysql, 这种情况下的多重-大查询如何处理?
- 这个sql语句怎么写
- mysql 数据库名有空格,脚本如何连?
- MYSQL 导入文件的时候出现如下错误,求大神帮忙看看啦
- mysql编码为latin1的数据库中的中文数据乱码问题
- 关于mysql查询遇到的难题,多表循环,求解决方法
-> id int,
-> year_col int
-> )
-> partition by range (year_col) (
-> partition p0 values less than (1991),
-> partition p1 values less than (1995),
-> partition p2 values less than (1999)
-> );
Query OK, 0 rows affected (0.03 sec)mysql>
mysql> alter table t1 add partition (PARTITION p3 values less than (2002));
Query OK, 0 rows affected (0.08 sec)
Records: 0 Duplicates: 0 Warnings: 0mysql>
ACMAIN_CHM啦!!!