cent7安装mysql5.7.25
时间: 2023-07-12 12:00:19 浏览: 110
你可以按照以下步骤在 CentOS 7 上安装 MySQL 5.7.25:
1. 下载 MySQL 社区版 5.7.25 Yum Repository:
```
wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
```
2. 安装 MySQL 社区版 5.7.25 Yum Repository:
```
sudo rpm -ivh mysql57-community-release-el7-11.noarch.rpm
```
3. 安装 MySQL 5.7.25:
```
sudo yum install mysql-community-server-5.7.25
```
4. 启动 MySQL 服务:
```
sudo systemctl start mysqld
```
5. 查看 MySQL 服务状态:
```
sudo systemctl status mysqld
```
如果服务正常运行,会输出类似以下内容:
```
● mysqld.service - MySQL Community Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2021-08-31 09:34:05 UTC; 2s ago
Process: 8158 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
Process: 8132 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 8160 (mysqld)
CGroup: /system.slice/mysqld.service
└─8160 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid
```
现在你已经成功安装 MySQL 5.7.25 并启动服务了。如果你需要修改 MySQL 的配置,可以编辑 `/etc/my.cnf` 文件。
阅读全文