mysql笔记
MYSQL数据库基础
1:两大分类:关系型数据库 mysql oracle sql-server
非关系型数据库 mogodb redis access
2:安装方式:yum源安装
tar包源码方式安装
phpstudy
宝塔
yum install -y mysql*
yum install -y mysql-server/maridb-server
3: DBA:数据库管理员
DBMS:数据库操作系统
DB:数据库
SQL:数据库查询语言
4: DQL:数据库查询语言
DDL:数据定义语言
DML:数据库操作语言
5: 创建名为school的数据库
切换到school数据库当中
使用source 命令来导入之前语句写好的表 source /etc/1.sql
6: limit select * from school limit x,y;
查询school的所有数据 并显示其从x号索引开始的y列数据
limit 0,2 显示第一行数据的两列数据
limit 1,2 显示第二行数据的两列
7 or and / || &&
select xxx from yyy where zzzz and/or www 连接多个条件语句
8: between and
select xxx from yyyy where number between 10 and 20;
select xxx fom yyy where number >=10 and number <=20;
9: 永真式
select xxxx from yyyy where xxxx or 1=1;
10: 永假式
select xxxx from yyyy where xxxx and 1=-1;
11: 逻辑运算
1:真 0:假
1+1=1
1+0=0
0+0=0
...............
12: union 联合查询
select xxxx from yyyy where xxxx union select xxxx from yyyy where xxxx ;
常见鱼sql注入中的联合注入
13: order by x 按照x字段来进行排序,有x字段则不报错,反之则报错,常用于sql注入中判断其字段数
select xxxx from yyyy where xxxx order by 4;
**任务**
1:整理出思维导图
2:练习上述的sq语句
3:对于sql语句的报错有所了解,知道那些报错语句具体是什么错误

浙公网安备 33010602011771号