mysql 修改表字段

来源:互联网 发布:mac版本升级 编辑:程序博客网 时间:2024/03/28 20:57
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
原创粉丝点击