1.1.更新YUM源
rpm -Uvh http://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
1.2.安装MySQL
yum -y install mysql-community-server --nogpgcheck
查看安装的版本号,用于验证已经完成安装
mysql -V
2 配置MySQL
2.1 启动服务并设定开机自动运行
systemctl start mysqld systemctl enable mysqld
2.2 记录下初始密码
grep 'temporary password' /var/log/mysqld.log
2.3MySQL安全性配置。
mysql_secure_installation