进入数据库
把MySQL.exe 丢进cmd`
然后 -u(帐号) -p(密码)
回车就进了~
show databases; //展示所有库
use (库名)//使用哪个库
----------------------增
create table (库名)(
名字 类型 属性(空格属性空格属性) null auto_increment,
col_name type default,
primary key(col_name)//设置主建
);
-----------------------插入数据
------------------------删
delete from tablename where (条件);
例
delete from sign where id = 1;
------------------------改
update (表名)
set col_name = value,col_name = valuewhere (条件);
例
update sign set name = 'aa',password = 'bb' where id = 1;
-------------------------查
13,select (哪一列,全选用 * ) from (表名) where 条件 |
order by 那一列作为排序 desc | //排序,从哪个作为条件 desc加入后为倒序
limit rom_limit; //只取出第几行,后的数字是第几行开始取几列
例
select password form sign order by password desc;//取出表格里所有password行,并且进行desc倒序排列
select * from sign limit 2,2;//跳掉1,2 取出3和4两行
...等等其他条件