centos7中用yum安装mysql8.0.26版本
时间: 2023-06-13 13:04:13 浏览: 230
CentOS 7 yum安装MySQL8.docx
要在CentOS 7上使用yum安装MySQL 8.0.26,请按照以下步骤操作:
1. 添加MySQL存储库
```
sudo rpm -Uvh https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm
```
2. 安装MySQL服务器
```
sudo yum install mysql-community-server
```
3. 启动MySQL服务
```
sudo systemctl start mysqld
```
4. 设置MySQL开机自启
```
sudo systemctl enable mysqld
```
5. 查看MySQL服务状态
```
sudo systemctl status mysqld
```
6. 获取MySQL初始密码
```
sudo grep 'temporary password' /var/log/mysqld.log
```
7. 登录MySQL
```
mysql -u root -p
```
8. 输入初始密码
9. 修改密码
```
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
```
10. 退出MySQL
```
exit
```
这样就完成了在CentOS 7上用yum安装MySQL 8.0.26的步骤。
阅读全文