技术分享
🗒️从运维的角度全方面了解 MySQL(完结)
00 分钟
2024-3-1
2024-4-19
type
status
date
slug
summary
tags
category
icon

1:MySQL 简介与发展

notion image

2:MySQL 的优势于应用场景

3:MySQL PG Oracle,分布式数据库对比

4:MySQL 的安装与配置

5:MySQL SQL语法基础

5.1:SQL 语言概述

5.2:数据库,表,列和行的概念

5.3:DDL(数据库定义语言)

5.4:DML(数据库操作语言)

5.5:DCL(数据库控制语言)

5.5.1:连接方式

5.5.2:权限管理

show grants for
show create user
grant select on *.* to *.* identified by 'xxx'
mysql.user 表密码串字段
5.55
权限 + 密码
不可用
可用
password
5.7
权限
用户密码
可用
authentication_string
8.0
权限
用户密码
不可用
authentication_string

5,5,3:常规函数

说明
函数
字符串函数
CONCAT,SUBSTRING,LENGTH,UPPER,LOWER,TRIM,REPLACE ......
数值函数
ABS,ROUNO,CEIL,FLOOR,MOD,RAND ......
日期和时间函数
NOW,CURDATE,CURTIME,TIME,YEAR,MONTH,DAY ......
条件函数
IF,CASE(一般存储过程等写,不建议 MySQL 中使用存储过程,业务逻辑尽量再业务代码中实现) ......
聚合函数
COUNT,SUM,AVG,MIN,MAX(一般查询中用) ......
分组函数
GROUP,CONCAT,GROUP BY ......
转换函数
CAST,CONVENRT ......
数据类型函数
CAST,CONVERT,DATE_FORMAT ......
数据库函数
DATABASE,USER,VERSION ......
系统函数
SLEEP ......

6:MySQL 存储,事务处理与锁

6.1:MySQL Server 的结构

notion image

6.2:管理工具与服务

6.3:连接池

6.4:SQL 接口 SQL Interface

6.5:解析器 Parser

6.6:查询优化器(Optimizer)

6.7:缓存器(Caches && Buffers)

6.8:InnoDB 存储引擎

notion image

6.9:InnoDB 多线程技术

6.10:InnoDBN缓存管理 LRU LIST

6.11:InnoDB 的脏页面管理

notion image

6.12:日志管理

notion image

6.13:Double Write

6.14:两阶段提交

notion image
notion image
notion image

6.15:事务的概念与介绍

6.16:4种隔离级别

6.17:如何选择合适的隔离级别

6.18:InnoDB锁系统介绍

6.18.1:锁的类型

X
S
X
不兼容
不兼容
S
不兼容
兼容
IS
IX
S
X
IS
兼容
兼容
兼容
不兼容
IX
兼容
兼容
不兼容
不兼容
S
兼容
不兼容
兼容
不兼容
X
不兼容
不兼容
不兼容
不兼容

6.18.2:加锁操作

6.19:死锁实战

7:MySQL 索引

7.1:索引类型

notion image

7.2:索引的使用与优化

7.3:索引的管理

7.4:冗余索引

7.5:索引优化实战

7.6:如何收集慢 SQL

7.7:理解执行计划

Columnt
JSON Name
Meaning
id
select_id
The Select identifier
select_type
None
The Select type
table
table_name
The table for the output row
partitions
partitions
The matching partitions
type
access_type
The join type
possible_keys
possible_keys
The possible indexes to choose
key
key
The index actually chosen
key_len
key_length
The length of the chosen key
ref
ref
The columns compared to the index
rows
rows
Estimate of rows to be examined
filtered
filtered
Percentage of rows filtered by table condition
Extra
None
Additional information

8:MySQL 主从复制与高可用

8.1:主从复制的原理

notion image

8.2:主从环境搭建

8.3:主从管理命令

8.4:主从复制的分类

8.5:常见的Binlog操作

8.6:主从复制常见的故障及解决方案

8.7:主从延迟问题

8.8:GTID 模式主从集群

8.9:数据库高可用方案

notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image

9:MySQL 备份与恢复实战

9.1:MySQL 备份策略

9.2:mysqldump 原理及常见应用

9.3:xtrabackup 原理及常见应用

notion image

9.4:mysqlbinlog 的使用