1、登录mysql网址,下载mysql的yum源




2、导入rpm源到linux服务器

3、安装mysql yum源
[root@localhost software]# yum localinstall mysql80-community-release-el7-3.noarch.rpm

[root@localhost software]# cd /etc/yum.repos.d/ [root@localhost yum.repos.d]# ll

4、编辑mysql的yum源配置,指定要安装的mysql版本
[root@localhost yum.repos.d]# vim mysql-community.repo

注意:enabled:是否启用这个仓库,1为起用,0为禁用
5、使用yum安装mysql
[root@localhost yum.repos.d]# yum install mysql-community-server
6、启动mysql
[root@localhost yum.repos.d]# service mysqld start Redirecting to /bin/systemctl start mysqld.service
在 /var/log/mysqld.log 中找到初始密码,登录mysql,进行密码修改
alter user 'root'@'localhost' identified by 'Gdwfq@123';
|