Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update CentOS7安装mysql5.7.md
修改MD语法
  • Loading branch information
yeluod authored Oct 19, 2022
commit 840e0927248c8680e015d588b6e0583e9170d7ac
18 changes: 9 additions & 9 deletions linux/CentOS7安装mysql5.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@


* 卸载系统默认mariadb
```
```shell
rpm -qa | grep mariadb;
rpm -e mariadb-libs-5.5.60-1.el7_5.x86_64 --nodeps
```

* 上传并解压文件
```
```shell
mkdir /usr/local/mysql/
tar -vxf mysql-5.7.33-1.el7.x86_64.rpm-bundle.tar -C /usr/local/mysql/
```

* 安装
```
```shell
cd /usr/local/mysql/
rpm -ivh mysql-community-common-5.7.33-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.33-1.el7.x86_64.rpm
Expand All @@ -27,28 +27,28 @@ rpm -ivh mysql-community-server-5.7.33-1.el7.x86_64.rpm
```

* 删除默认文件
```
```shell
rm -rf /var/lib/mysql/*
```

* 启动服务
```
```shell
service mysqld start
systemctl enable mysqld
```

* 查看初始密码
```
```shell
grep 'temporary password' /var/log/mysqld.log;
```

* 登录
```
```shell
mysql -u root -p aUuTak1Geg!k
```

* 重新设置密码
```
```shell
set password for 'root'@'localhost' = password('Root123@');
#修改密码验证强度
set global validate_password_policy=LOW;
Expand All @@ -60,4 +60,4 @@ grant all privileges on *.* to root@"%" identified by '123456' with grant option
grant all privileges on *.* to root@localhost identified by '123456' with grant option;
#刷新权限
flush privileges;
```
```