给个例子,模仿即可:
drop database if exists tt; create database tt default character set utf8; use tt; create table admin_tb( id int(11) auto_increment primary key, username varchar(20) not null unique, password varchar(20) not null, name varchar(10) not null, createtime timestamp default current_timestamp )engine=InnoDB auto_increment=1 default charset=utf8; INSERT INTO admin_tb (username,password,name) VALUES ('xx','xx','xx'); create table user_tb( id int(11) auto_increment primary key, username varchar(20) not null unique, password varchar(20) not null, name varchar(20) not null, nicknamek varchar(20), sex varchar(1) check(sex='男' or sex='女'), birth date, phone varchar(15), qq varchar(11), integral int(5) default 5, signature varchar(200), avater varchar(200), /*头像*/ status int(2) default 1, createtime timestamp default current_timestamp )engine=InnoDB auto_increment=1 default charset=utf8; INSERT INTO user_tb (username,password,name,nicknamek,sex,birth,phone,qq,integral,signature) VALUES ('xx','xx','xx','xx','m','1996-7-27','33','33','5','from xx'); INSERT INTO user_tb (username,password,name,nicknamek,sex,birth,phone,qq,integral,signature) VALUES ('xx','xx','xx','xx','m','1996-7-27','333','33','5','from xx');