Centos7 yum安装mysql5.7

1.  下载mysql源rpm包

[root@VM-0-11-centos ~]# wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm

2.  安装mysql软件源

[root@VM-0-11-centos ~]# yum localinstall mysql57-community-release-el7-8.noarch.rpm -y

3.   开始安装mysql-server服务端和客户端

[root@VM-0-11-centos ~]# yum install mysql-community-server mysql -y

 

 4.   启动mysql服务

[root@VM-0-11-centos ~]# systemctl restart mysqld

 5.  找到第一次启动mysql-server时,软件自动分配的密码

[root@VM-0-11-centos ~]# grep temporary /var/log/mysqld.log

 

 6.  然后登陆mysql-server

[root@VM-0-11-centos ~]# mysql -uroot -pR4LsefrRJo&-

 

 7.   yum安装mysql5.7服务完成

 

posted @ 2021-04-22 11:14  Shanghai-Roy  阅读(1348)  评论(0编辑  收藏  举报