centos7安装mysql5.7的踩坑记录

目录
  • 下载安装mysql
    • 下载rpm安装包
    • 安装
    • 查看安装情况
    • 安装server
  • 这里发现这个问题:
  • 备注:
  • 总结

今天使用centos7进行mysql5.7的安装,出现挫折,记录如下:

下载安装mysql

下载rpm安装包

wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
--2022-01-22 03:01:53--  http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
Resolving dev.mysql.com (dev.mysql.com)... 137.254.60.11
Connecting to dev.mysql.com (dev.mysql.com)|137.254.60.11|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm [following]
--2022-01-22 03:01:54--  https://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
Connecting to dev.mysql.com (dev.mysql.com)|137.254.60.11|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://repo.mysql.com//mysql57-community-release-el7-8.noarch.rpm [following]
--2022-01-22 03:01:55--  https://repo.mysql.com//mysql57-community-release-el7-8.noarch.rpm
Resolving repo.mysql.com (repo.mysql.com)... 23.36.253.13
Connecting to repo.mysql.com (repo.mysql.com)|23.36.253.13|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9116 (8.9K) [application/x-redhat-package-manager]
Saving to: ‘mysql57-community-release-el7-8.noarch.rpm'

100%[=========================================================================================================================================================================>] 9,116       --.-K/s   in 0s      

2022-01-22 03:01:55 (249 MB/s) - ‘mysql57-community-release-el7-8.noarch.rpm' saved [9116/9116]

安装

yum localinstall mysql57-community-release-el7-8.noarch.rpm
(py3) [root@localhost opt]# yum localinstall mysql57-community-release-el7-8.noarch.rpm
Loaded plugins: fastestmirror, langpacks
Examining mysql57-community-release-el7-8.noarch.rpm: mysql57-community-release-el7-8.noarch
Marking mysql57-community-release-el7-8.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package mysql57-community-release.noarch 0:el7-8 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================================================
 Package                                                  Arch                                  Version                               Repository                                                              Size
===================================================================================================================================================================================================================
Installing:
 mysql57-community-release                                noarch                                el7-8                                 /mysql57-community-release-el7-8.noarch                                8.2 k

Transaction Summary
===================================================================================================================================================================================================================
Install  1 Package

Total size: 8.2 k
Installed size: 8.2 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : mysql57-community-release-el7-8.noarch                                                                                                                                                          1/1
  Verifying  : mysql57-community-release-el7-8.noarch                                                                                                                                                          1/1 

Installed:
  mysql57-community-release.noarch 0:el7-8                                                                                                                                                                         

Complete!

查看安装情况

(py3) [root@localhost opt]# yum repolist enabled | grep "mysql.*-community.*"
mysql-connectors-community/x86_64       MySQL Connectors Community           167
mysql-tools-community/x86_64            MySQL Tools Community                 82
mysql57-community/x86_64                MySQL 5.7 Community Server           564

安装server

yum -y install mysql-community-server
(py3) [root@localhost opt]# yum -y install mysql-community-server
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.tuna.tsinghua.edu.cn
 * extras: mirrors.tuna.tsinghua.edu.cn
 * updates: mirrors.tuna.tsinghua.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.7.37-1.el7 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.7.37-1.el7 for package: mysql-community-server-5.7.37-1.el7.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 5.7.9 for package: mysql-community-server-5.7.37-1.el7.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.7.37-1.el7 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.7.9 for package: mysql-community-client-5.7.37-1.el7.x86_64
---> Package mysql-community-common.x86_64 0:5.7.37-1.el7 will be installed
--> Running transaction check
---> Package mysql-community-libs.x86_64 0:5.7.37-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================================================
 Package                                                   Arch                                      Version                                            Repository                                            Size
===================================================================================================================================================================================================================
Installing:
 mysql-community-server                                    x86_64                                    5.7.37-1.el7                                       mysql57-community                                    174 M
Installing for dependencies:
 mysql-community-client                                    x86_64                                    5.7.37-1.el7                                       mysql57-community                                     25 M
 mysql-community-common                                    x86_64                                    5.7.37-1.el7                                       mysql57-community                                    311 k
 mysql-community-libs                                      x86_64                                    5.7.37-1.el7                                       mysql57-community                                    2.4 M

Transaction Summary
===================================================================================================================================================================================================================
Install  1 Package (+3 Dependent packages)

Total download size: 202 M
Installed size: 878 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/mysql57-community/packages/mysql-community-common-5.7.37-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY               ]  0.0 B/s | 767 kB  --:--:-- ETA
Public key for mysql-community-common-5.7.37-1.el7.x86_64.rpm is not installed
(1/4): mysql-community-common-5.7.37-1.el7.x86_64.rpm                                                                                                                                       | 311 kB  00:00:00
(2/4): mysql-community-libs-5.7.37-1.el7.x86_64.rpm                                                                                                                                         | 2.4 MB  00:00:04
(3/4): mysql-community-client-5.7.37-1.el7.x86_64.rpm                                                                                                                                       |  25 MB  00:01:01
(4/4): mysql-community-server-5.7.37-1.el7.x86_64.rpm                                                                                                                                       | 174 MB  00:03:40
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                              917 kB/s | 202 MB  00:03:45
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:
 Userid     : "MySQL Release Engineering <mysql-build@oss.oracle.com>"
 Fingerprint: a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5
 Package    : mysql57-community-release-el7-8.noarch (@/mysql57-community-release-el7-8.noarch)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

Public key for mysql-community-server-5.7.37-1.el7.x86_64.rpm is not installed

 Failing package is: mysql-community-server-5.7.37-1.el7.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

这里发现这个问题:

Public key for mysql-community-server-5.7.37-1.el7.x86_64.rpm is not installed

 Failing package is: mysql-community-server-5.7.37-1.el7.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

备注:

由于MySQL在CentOS7中收费了,所以已经不支持MySQL了,取而代之在CentOS7内部集成了mariadb,而安装MySQL的话会和MariaDB的文件冲突。

如果安装的话,需要卸载MariaDB,另外也注意安装正确的安装包,以及安装顺序,建议参考我的另外一篇文章。

总结

到此这篇关于centos7安装mysql5.7踩坑的文章就介绍到这了,更多相关centos7安装mysql5.7内容请搜索我们以前的文章或继续浏览下面的相关文章希望大家以后多多支持我们!

(0)

相关推荐

  • CentOS7安装mysql5.7解压缩版简明教程

    本文实例讲述了CentOS7安装mysql5.7解压缩版的方法.分享给大家供大家参考,具体如下: 1.下载安装包 http://dev.mysql.com/downloads/mysql/#downloads 推荐下载通用安装方法的TAR包 2.检查库文件是否存在,如有删除. [root@localhost Desktop]$ rpm -qa | grep mysql mysql-libs-5.1.52-1.el6_0.1.x86_64 [root@localhost ~]$ rpm -e my

  • centos7.3 安装mysql5.7.18的详细教程

    1查看Linux发行版本 [root@typecodes ~]# cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core) 2 下载MySQL官方的Yum Repository 根据Linux发行版本(CentOS.Fedora都属于红帽系),从mysql官方(http://dev.mysql.com/downloads/repo/yum/)获取Yum Repository. [root@typecodes ~]# wget -i

  • CentOS7环境下源码安装MySQL5.7的方法

    本文实例讲述了CentOS7环境下源码安装MySQL5.7的方法.分享给大家供大家参考,具体如下: 安装依赖包 复制代码 代码如下: yum -y install autoconf automake libtool cmake ncurses-devel openssl-devel lzo-devel zlib-devel gcc gcc-c++ 下载相应源码包 wget http://downloads.sourceforge.net/project/boost/boost/1.59.0/bo

  • Linux下Centos7安装Mysql5.7.19的详细教程

    1.下载mysql 网址: https://dev.mysql.com/downloads/mysql/ 2.选择源码包,通用版点击下载 直接下载就可以了,不用登录 3.解压编译 tar -zxvf mysql-5.7.19.tar.gz cd mysql-5.7.19.tar.gz 创建数据目录  mkdir -p /data/mysql 先用cmake编译,没有这个命令需要先yum安装 cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql/ #这个是编译

  • CentOS7 通过YUM安装MySQL5.7的步骤详解

    1.进入到要存放安装包的位置 cd /home/lnmp 2.查看系统中是否已安装 MySQL 服务,以下提供两种方式: rpm -qa | grep mysql yum list installed | grep mysql 3.如果已安装则删除 MySQL 及其依赖的包: yum -y remove mysql-libs.x86_64 4.下载 mysql57-community-release-el7-8.noarch.rpm 的 YUM 源: wget http://repo.mysql

  • Centos7.3下mysql5.7.18安装并修改初始密码的方法

    本文为大家分享了Centos7.3下mysql5.7.18的安装,和修改初始密码,供大家参考,具体内容如下 1.官方安装文档 http://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/ 2.下载 Mysql yum包 http://dev.mysql.com/downloads/repo/yum/ 下载到本地再上传到服务器,或者使用wget 直接下载 wget http://repo.mysql.com/mysql57-community-re

  • CentOS7.2安装MySql5.7并开启远程连接授权的教程

    1.安装mysql5.7 CentOS 7之后的版本yum的默认源中使用MariaDB替代原先MySQL,因此安装方式较为以往有一些改变: 下载mysql的源 wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm 安装yum库 yum localinstall -y mysql57-community-release-el7-7.noarch.rpm 安装MySQL yum install -y mysq

  • CentOS7 64位下MySQL5.7安装与配置教程

    安装环境:CentOS7 64位 MINI版,安装MySQL5.7 1.配置YUM源 在MySQL官网中下载YUM源rpm安装包:http://dev.mysql.com/downloads/repo/yum/ # 下载mysql源安装包 shell> wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm # 安装mysql源 shell> yum localinstall mysql57-commun

  • Centos7使用yum安装Mysql5.7.19的详细步骤

    Centos7的yum源中默认是没有mysql,因为现在已经用mariaDB代替mysql了. 首先我们下载mysql的repo源,我们可以去mysql官网找最新的repo源地址 地址: https://dev.mysql.com/downloads/repo/yum/ 开始在linux下下载repo源 //下载mysql rpm包 # wget http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm //安装my

  • Centos7安装和配置Mysql5.7

    第一步:获取mysql YUM源 进入mysql官网获取RPM包下载地址 https://dev.mysql.com/downloads/repo/yum/ 右击 复制链接地址 https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm 得到rpm包的地址 第二步:下载和安装mysql源 先下载 mysql源安装包 [root@localhost ~]# wget https://dev.mysql.com/get/

随机推荐