1.下载yum源:
wget https://dev.mysql.com/get/mysql80-community-release-el7-5.noarch.rpm
2.执行安装:
rpm -ivh mysql80-community-release-el7-5.noarch.rpm
3.开始安装
yum install -y mysql-server
4.启动mysql服务
systemctl start mysqld
5.查看临时密码登陆mysql,然后修改密码
grep 'temporary password' /var/log/mysqld.log
1)登录mysql
mysql -uroot -p
2)修改密码
alter user 'root'@'localhost' identified by 'Admin123456!';
3)开启远程登录
use mysql ;
update user set host = '%' where user = 'root';
FLUSH PRIVILEGES;
4)重启数据库
service mysqld restart
5)查看数据库启动状态
systemctl status mysqld
出现如下界面,代表安装成功: