centos7安装mysql5.7经验记录


Posted in Servers onMay 02, 2022

今天使用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经验记录的文章就介绍到这了!


Tags in this post...

Servers 相关文章推荐
本地通过nginx配置反向代理的全过程记录
Mar 31 Servers
nginx location中多个if里面proxy_pass的方法
Mar 31 Servers
Apache POI的基本使用详解
Nov 07 Servers
Z-Order加速Hudi大规模数据集方案分析
Mar 31 Servers
Kubernetes中Deployment的升级与回滚
Apr 01 Servers
Nginx动静分离配置实现与说明
Apr 07 Servers
阿里云服务器Ubuntu 20.04上安装Odoo 15
May 20 Servers
Win2008系统搭建DHCP服务器
Jun 25 Servers
Python安装及建立虚拟环境的完整步骤
Jun 25 Servers
Zabbix对Kafka topic积压数据监控的问题(bug优化)
Jul 07 Servers
Docker部署Mysql8的实现步骤
Jul 07 Servers
Tomcat安装使用及部署Web项目的3种方法汇总
Aug 14 Servers
使用 Docker Compose 构建复杂的多容器App
Apr 30 #Servers
搭建Yolov5服务器
KVM基础命令详解
Apr 30 #Servers
Win10 Anaconda安装python-pcl
如何开启Apache,Nginx和IIS服务器的GZIP压缩功能
Apr 29 #Servers
解决IIS7下无法绑定https主机的问题
IIS服务器中设置HTTP重定向访问HTTPS
You might like
PHP随机生成信用卡卡号的方法
2015/03/23 PHP
PHP魔术方法之__call与__callStatic使用方法
2017/07/23 PHP
php和html的区别点详细总结
2019/09/24 PHP
js 使FORM表单的所有元素不可编辑的示例代码
2013/10/17 Javascript
jquery使用淘宝接口跨域查询手机号码归属地实例
2013/11/28 Javascript
通过JS来动态的修改url,实现对url的增删查改
2014/09/01 Javascript
jQuery中animate动画第二次点击事件没反应
2015/05/07 Javascript
每天一篇javascript学习小结(Boolean对象)
2015/11/12 Javascript
js跨浏览器的事件侦听器和事件对象的使用方法
2015/12/17 Javascript
nodejs 的 session 简单使用
2016/06/06 NodeJs
easyui datebox 时间限制,datebox开始时间限制结束时间,datebox截止日期比起始日期大的实现代码
2017/01/12 Javascript
vue2.0开发入门笔记之.vue文件的生成和使用
2017/09/19 Javascript
Node.js使用Koa搭建 基础项目
2018/01/08 Javascript
jQuery实现雪花飘落效果
2020/08/02 jQuery
Python图形绘制操作之正弦曲线实现方法分析
2017/12/25 Python
python3爬虫获取html内容及各属性值的方法
2018/12/17 Python
Python增强赋值和共享引用注意事项小结
2019/05/28 Python
python实现比对美团接口返回数据和本地mongo数据是否一致示例
2019/08/09 Python
在python中利用pycharm自定义代码块教程(三步搞定)
2020/04/15 Python
Python+unittest+DDT实现数据驱动测试
2020/11/30 Python
美国Curacao百货连锁店网站:iCuracao.com
2019/07/20 全球购物
罗马尼亚购物网站:Vivantis.ro
2019/07/20 全球购物
adidas菲律宾官网:adidas PH
2020/02/07 全球购物
SAZAC的动物连体衣和动物睡衣:Kigurumi Shop
2020/03/14 全球购物
Monki官网:斯堪的纳维亚的独立时尚品牌
2020/11/09 全球购物
大学班长的职责
2014/01/27 职场文书
高速铁道技术专业求职信
2014/08/09 职场文书
授权委托书(完整版)
2014/09/10 职场文书
公司领导班子四风对照检查材料
2014/09/27 职场文书
赔偿协议书怎么写
2015/01/28 职场文书
商务司机岗位职责
2015/04/10 职场文书
管理失职检讨书
2015/05/05 职场文书
处罚决定书范文
2015/06/24 职场文书
党校团干班培训心得体会
2016/01/06 职场文书
react合成事件与原生事件的相关理解
2021/05/13 Javascript
Nginx源码编译安装过程记录
2021/11/17 Servers