centos7.0安装mysql5.7
时间: 2023-11-23 09:55:11 浏览: 110
centos 7.0上安装mysql
在CentOS7.0上安装MySQL5.7需要以下步骤:
1. 下载MySQL5.7的rpm包,包括mysql-community-client、mysql-community-common、mysql-community-libs和mysql-community-server。
2. 安装依赖包:
```shell
yum install -y libaio
```
3. 安装MySQL5.7:
```shell
rpm -ivh mysql-community-common-5.7.17-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.17-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.17-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.7.17-1.el7.x86_64.rpm
```
4. 启动MySQL服务:
```shell
systemctl start mysqld
```
5. 设置MySQL开机自启动:
```shell
systemctl enable mysqld
```
6. 查看MySQL服务状态:
```shell
systemctl status mysqld
```
7. 登录MySQL:
```shell
mysql -u root -p
```
8. 修改MySQL的root用户密码:
```sql
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
```
阅读全文