七、管理表记录(增删改查)(db3.usertab)
插入记录
mysql> insert into usertab
values
(43,"yaya","x",1001,1001,"","/home/yaya","/bin/bash");
mysql> insert into usertab
values (50,"yaya2","x",1002,1002,"","/home/yaya2","/sbin/nologin"),(51,"7yaya","x",1003,1003,"","/home/7yaya","/sbin/nologin");
insert into usertab(username,homedir,shell)
values
("lucy","/home/lucy","/bin/bash");
insert into usertab(username,homedir,shell)
values
("lu8cy","/home/lu8cy","/bin/bash"),("tom","/home/tom","/bin/bash"),("lilei","/home/lilei","/bin/bash");
+++++++++查看记录
select * from db3.usertab;
select * from usertab where id = 1;
select id,username,password from db3.usertab;
select username,uid,shell from usertab where id = 1;
------修改记录
update db3.usertab set password="A" ;
update db3.usertab set password="x" where id=1;
select * from db3.usertab;
-----删除记录
delete from db3.usertab where id=3;