MYSQL 删除主键出现异常

MYSQL 删除主键出现错误!

 

mysql> select * from a;

+—-+——+———-+

| id | name | password |

+—-+——+———-+

| 1 | a | NULL |

| 2 | a | NULL |

| 3 | a | NULL |

| 4 | a | NULL |

+—-+——+———-+

4 rows in set (0.00 sec)

mysql> alter table a drop primary key(id);

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 ‘(id)’

 at line 1

mysql>


什么原因啊????



alter table a drop primary key;

就行了,为什么要画蛇添足地加上个 (id) 呢?

参考一下官方手册中的语法说明。

MySQL官方文档 http://dev.mysql.com/doc/refman/5.1/zh/index.html

MYSQL 删除主键出现异常

相关文章:

你感兴趣的文章:

标签云: