centos7安装mysql8.0.36
时间: 2024-05-08 09:13:33 浏览: 139
CentOS7下mysql5.7.10的安装步骤
CentOS 7安装MySQL 8.0.36的步骤如下:
1. 更新系统:
```
sudo yum update
```
2. 添加MySQL Yum Repository:
```
sudo rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
```
3. 安装MySQL服务器:
```
sudo yum install mysql-server
```
4. 启动MySQL服务:
```
sudo systemctl start mysqld
```
5. 查看MySQL服务状态:
```
sudo systemctl status mysqld
```
6. 运行MySQL安全性脚本,设置root密码等:
```
sudo mysql_secure_installation
```
7. 登录MySQL:
```
sudo mysql -u root -p
```
8. 创建新的MySQL用户并授权:
```
CREATE USER 'new_user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'new_user'@'localhost';
FLUSH PRIVILEGES;
```
9. 退出MySQL:
```
exit
```
以上是CentOS 7安装MySQL 8.0.36的基本步骤。
阅读全文