# 安装包
yum localinstall http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm # 查看安装包 yum repolist enabled | grep "mysql.*-community.*" mysql-connectors-community/x86_64 MySQL Connectors Community 17 mysql-tools-community/x86_64 MySQL Tools Community 31 mysql56-community/x86_64 MySQL 5.6 Community Server 199 # 安装mysql yum install mysql-community-server -y # 设置开机启动 systemctl enable mysqld # 启动 systemctl start mysqld # 重置密码 mysql_secure_installation