将 MySQL 列更改为 AUTO_INCREMENT
我正在尝试修改一个表以使其主键列 AUTO_INCREMENT
事后.我尝试了以下 SQL,但收到了语法错误通知.
ALTER TABLE 文档ALTER COLUMN document_id AUTO_INCREMENT
我做错了什么还是不可能?
<前>+--------------------+|版本() |+--------------------+|5.0.75-0ubuntu10.2 |+--------------------+ 解决方案ALTER TABLE document MODIFY COLUMN document_id INT auto_increment
I’m trying to modify a table to make its primary key column AUTO_INCREMENT
after the fact. I have tried the following SQL, but got a syntax error notification.
ALTER TABLE document
ALTER COLUMN document_id AUTO_INCREMENT
Am I doing something wrong or is this not possible?
+--------------------+ | VERSION() | +--------------------+ | 5.0.75-0ubuntu10.2 | +--------------------+
解决方案
ALTER TABLE document MODIFY COLUMN document_id INT auto_increment
相关文章