有一张表,已经创建了,是一张普通的表,先要对这张表进行hash分区,我用一下语句创建提示错误:
mysql> alter table 33
-> partition by hash(id)
-> partitions 2;
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 '33
partition by hash(id)
partitions 2' at line 1难道对普通标不能进行分区,必须要在创建表的时候指定分区类型?
mysql> alter table 33
-> partition by hash(id)
-> partitions 2;
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 '33
partition by hash(id)
partitions 2' at line 1难道对普通标不能进行分区,必须要在创建表的时候指定分区类型?
mysql> create table x (
-> id int primary key,
-> c int
-> ) engine=myisam;
Query OK, 0 rows affected (0.10 sec)mysql> alter table x
-> PARTITION BY HASH(id)
-> PARTITIONS 2;
Query OK, 0 rows affected (0.15 sec)
Records: 0 Duplicates: 0 Warnings: 0mysql>
alter table tb
partition by hash(id)
partitions 2;
alter table tb
partition by hash(id)
partitions 2;