create table tab(
id int not null AUTO_INCREMENT primary key,
isMarry int default 1
);
insert into tab() values();//向表中插入记录
alter table tab add info char(50) null;
alter table tab add info1 char(50) not null default 123;
alter table tab drop info1; //删除字段
mysql>
SET @auto_increment_increment=10;
Query OK, 0 rows affected (0.00 sec)
mysql>
SHOW VARIABLES LIKE 'auto_inc%';
+--------------------------+-------+
| Variable_name | Value |
+--------------------------+-------+
| auto_
increment_
increment | 10 |
| auto_
increment_offset | 1 |
+--------------------------+-------+
mysql>
SELECT col FROM autoinc1;
+-----+
| col |
+-----+
| 1 |
| 11 |
| 21 |
| 31 |
+-----+
mysql>
SET @auto_increment_offset=5;
Query OK, 0 rows affected (0.00 sec)
mysql>
SHOW VARIABLES LIKE 'auto_inc%';
+--------------------------+-------+
| Variable_name | Value |
+--------------------------+-------+
| auto_
increment_
increment | 10 |
| auto_
increment_offset | 5 |
+--------------------------+-------+
阅读(2272) | 评论(0) | 转发(0) |