CentOS7安装MySql8.0
时间: 2023-11-17 08:03:42 浏览: 125
Centos7安装mysql8.0
在CentOS7上安装MySQL8.0,可以按照以下步骤进行操作:
1. 下载MySQL8.0的rpm包:
```
wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
```
2. 安装MySQL8.0的rpm包:
```
sudo rpm -ivh mysql80-community-release-el7-3.noarch.rpm
```
3. 安装MySQL8.0:
```
sudo yum install mysql-community-server
```
4. 启动MySQL服务:
```
sudo systemctl start mysqld
```
5. 查看MySQL服务状态:
```
sudo systemctl status mysqld
```
6. 设置MySQL开机自启动:
```
sudo systemctl enable mysqld
```
7. 登录MySQL:
```
mysql -u root -p
```
8. 修改MySQL的root用户密码:
```
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
```
9. 退出MySQL:
```
exit;
```
阅读全文