mysql 修改表字段

mysql> alter table newcar change id id int(11) not null AUTO_INCREMENT;
Query OK, 10 rows affected (0.16 sec)
Records: 10  Duplicates: 0  Warnings: 0

mysql> alter table newcar change id id int(11);
Query OK, 10 rows affected (0.17 sec)
Records: 10  Duplicates: 0  Warnings: 0

mysql> alter table newcar drop primary key;
Query OK, 10 rows affected (0.13 sec)
Records: 10  Duplicates: 0  Warnings: 0

mysql> alter table newcar add primary key(id);
Query OK, 10 rows affected (0.16 sec)
Records: 10  Duplicates: 0  Warnings: 0

mysql> alter table newcar change id id int(11) not null AUTO_INCREMENT;
Query OK, 10 rows affected (0.19 sec)
Records: 10  Duplicates: 0  Warnings: 0
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章