---恢复内容开始---

我安装的是最小版本的centos7

所以先安装gcc:yum install gcc

然后下载mysql压缩包

地址:http://www.mysql.com/downloads/

 

下载后在linux中解压:tar -xvf mysql-5.7.20-1.el7.x86_64.rpm-bundle.tar

我们得到如下文件

顺序安装common libs-5.7.19 client server。

安装第二个包libs-5.7.19时可能遇见这个问题

出现依赖冲突,这是因为CentOS的默认数据库已经不再是MySQL了,而是MariaDB。查看当前安装的mariadb包:rpm -qa | grep mariadb 然后删除包

接下来顺序安装,在安装第四个server的时候可能会遇见以下问题:

error: Failed dependencies:
/usr/bin/perl is needed by mysql-community-server-5.7.17-1.el7.x86_64.rpm

使用yum安装就行:yum install perl

安装完成初始化:mysqld --initialize

查看初始化产生的密码:grep 'temporary password' /va/log/mysqld.log

启动数据库 :systemctl start mysqld.service

然后使用刚才的密码登陆:mysql -uroot -p'密码'

修改密码:set password=password('密码');

搞定

---恢复内容结束---

an我安装的是最小版本的centos7

所以先安装gcc:yum install gcc

然后下载mysql压缩包

地址:http://www.mysql.com/downloads/

 

下载后在linux中解压:tar -xvf mysql-5.7.20-1.el7.x86_64.rpm-bundle.tar

我们得到如下文件

顺序安装common libs-5.7.19 client server。

安装第二个包libs-5.7.19时可能遇见这个问题

出现依赖冲突,这是因为CentOS的默认数据库已经不再是MySQL了,而是MariaDB。查看当前安装的mariadb包:rpm -qa | grep mariadb 然后删除包

接下来顺序安装,在安装第四个server的时候可能会遇见以下问题:

error: Failed dependencies:
/usr/bin/perl is needed by mysql-community-server-5.7.17-1.el7.x86_64.rpm

使用yum安装就行:yum install perl

安装完成初始化:mysqld --initialize

查看初始化产生的密码:grep 'temporary password' /va/log/mysqld.log

启动数据库 :systemctl start mysqld.service

然后使用刚才的密码登陆:mysql -uroot -p'密码'

修改密码:set password=password('密码');

搞定