利用docker安装mysql
docker run -d --name mysql -v mysql:/var/lib/mysql -e MYSQL_ALLOW_EMPTY_PASSWORD=true mysql
(root密码为空)
直接命令进入:mysql
创建表
CREATE TABLE info( id int, name VARCHAR(40) NOT NULL, sex VARCHAR(4) NOT NULL, birthday date NOT NULL, job VARCHAR(100) NOT NULL, PRIMARY KEY ( id ) );
插入数据
insert into employee(id,name,sex,birthday,entry_date,salary,resume) values(1,'zhangsan','male','1993-03-04','2016-11-10','1000','i am a developer'); insert into employee(id,name,sex,birthday,entry_date,salary,resume) values(2,'lisi','male','1993-03-04','2016-11-10','1000','i am a developer'); insert into employee(id,name,sex,birthday,entry_date,salary,resume) values(3,'zhaowu','male','1993-03-04','2016-11-10','1000','i am a developer'); insert into employee(id,name) values(4,'houliu'); insert into employee(id,name) values(5,'xiaqi'); insert into employee(id,sex) values(6,'man');