mysql 创建表并设置主键自增

时间:2021-01-07 13:38:43

mysql 创建表:

mysql> create table user(
    -> userid int(4) primary key not null auto_increment,
    -> username varchar(16) not null,
    -> userpassword varchar(32) not null
    -> );

 

create table log(
logid int(4) primary key not null auto_increment,
logtitle varchar(32) not null,
logcontent varchar(160) not null,
logtime datetime not null,
userip varchar(64) not null
);