如何在CentOS8上安装Mysql5.7

在CentOS8上,默认情况下直接使用yum安装mysql,安装的是Mysql 8.0,在一些比较老的项目中,我们需要使用的mysql版本是5.7,下面我分享一个在CentOS8中安装Myslq5.7的方法。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
···
Dependencies resolved.
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
mysql x86_64 8.0.17-3.module_el8.0.0+181+899d6349 AppStream 11 M
Installing dependencies:
mysql-common x86_64 8.0.17-3.module_el8.0.0+181+899d6349 AppStream 143 k
Enabling module streams:
mysql 8.0

Transaction Summary
================================================================================
Install 2 Packages
···
阅读更多

如何重置Mysql5.7 root密码

分享一个mysql技巧,当你忘记mysql5.7的root密码时,需要重置root密码可以参考以下方法。

阅读更多

MySQL explain学习笔记

explain用法

查询居民id为“004386f02b6511e8ad1300163e08fb5b”的居民所在的部门信息:

1
2
3
explain select department.* from department,westation,citizen
where department.id = westation.department_id and westation.id = citizen.westation_id
and citizen.id="004386f02b6511e8ad1300163e08fb5b"
id select_type table type possible_key key key_len ref rows Extra
1 SIMPLE citizen const PRIMARY,FK_Citizen_Westation PRIMARY 128 const 1
1 SIMPLE westation const PRIMARY,department_id,FK_deparment_westation PRIMARY 128 const 1
1 SIMPLE department const PRIMARY PRIMARY 128 const 1
阅读更多