# CentOS7 安装 Mysql 5.7密码查看与修改
## 软件版本
```
CentOS release 6.9 (Final)
mysql Client Ver 14.14 Distrib 5.7.18, for Linux (x86_64) using EditLine wrapper
mysql Server 5.7.18
```
## 检测是否安装MySQLServer
检测下系统有没有自带的mysql:`yum list installed | grep mysql`
如果已经有的话执行命令 `yum -y remove mysql-libs.x86_64` 卸载已经安装的 MySQL 。
## 安装
使用 rpm 包进行mysql服务器的安装,具体下载地址在:https://dev.mysql.com/downloads/mysql/5.7.html#downloads
```
wget http://repo.mysql.com/yum/mysql-5.7-community/el/6/x86_64/mysql-community-server-5.7.18-1.el6.x86_64.rpm
rpm -ivh mysql-community-server-5.7.18-1.el6.x86_64.rpm
```
## 启动
```
service mysqld start
```
## 查看密码
安装完成之后会自动在 `/var/log/mysqld.log` 中生成连接的密码