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 相关文章推荐
Centos7.7 64位利用本地完整安装包安装lnmp/lamp套件教程
Mar 09 Servers
Nginx设置日志打印post请求参数的方法
Mar 31 Servers
Filebeat 采集 Nginx 日志的方法
Mar 31 Servers
如何在centos上使用yum安装rabbitmq-server
Mar 31 Servers
总结高并发下Nginx性能如何优化
Nov 01 Servers
Nginx反向代理、重定向
Apr 13 Servers
阿里云ECS云服务器快照的概念以及如何使用
Apr 21 Servers
IIS服务器中设置HTTP重定向访问HTTPS
Apr 29 Servers
tomcat默认最大连接数及相关调整方法
May 06 Servers
Nginx 匹配方式
May 15 Servers
Win10系统搭建ftp文件服务器详细教程
Aug 05 Servers
Flink 侧流输出源码示例解析
Sep 23 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 和 MySQL 基础教程(一)
2006/10/09 PHP
session在PHP大型web应用中的使用
2011/06/25 PHP
php数组函数序列之asort() - 对数组的元素值进行升序排序,保持索引关系
2011/11/02 PHP
采用PHP函数memory_get_usage获取PHP内存清耗量的方法
2011/12/06 PHP
PHP中func_get_args(),func_get_arg(),func_num_args()的区别
2013/09/30 PHP
php获取指定范围内最接近数的方法
2015/06/02 PHP
PHP7新增运算符用法实例分析
2016/09/26 PHP
提高网站性能之 如何对待JavaScript
2009/10/31 Javascript
js图片滚动效果时间可随意设定当鼠标移上去时停止
2014/06/26 Javascript
node.js中的console.info方法使用说明
2014/12/09 Javascript
微信小程序之MaterialDesign--input组件详解
2017/02/15 Javascript
Vue中的Vux配置指南
2017/12/08 Javascript
js使用cookie实现记住用户名功能示例
2019/06/13 Javascript
原生JavaScript实现刮刮乐
2020/09/29 Javascript
列举Python中吸引人的一些特性
2015/04/09 Python
pandas数据处理基础之筛选指定行或者指定列的数据
2018/05/03 Python
Python实用工具FuckIt.py介绍
2019/07/02 Python
python遍历文件目录、批量处理同类文件
2019/08/31 Python
Python 脚本实现淘宝准点秒杀功能
2019/11/13 Python
python循环输出三角形图案的例子
2019/11/22 Python
python异常处理和日志处理方式
2019/12/24 Python
python3+openCV 获取图片中文本区域的最小外接矩形实例
2020/06/02 Python
HTML5之SVG 2D入门4—笔画与填充
2013/01/30 HTML / CSS
澳大利亚网上买书:Angus & Robertson
2019/07/21 全球购物
澳大利亚运动鞋商店:Platypus Shoes
2019/09/27 全球购物
黑猩猩商店:The Chimp Store
2020/02/12 全球购物
试解释COMMIT操作和ROLLBACK操作的语义
2014/07/25 面试题
remote接口和home接口主要作用
2013/05/15 面试题
创业者是否需要商业计划书?
2014/02/07 职场文书
欢迎横幅标语
2014/06/17 职场文书
个人股份合作协议书
2014/10/24 职场文书
委托公证书格式
2015/01/26 职场文书
大学生自荐信怎么写
2015/03/26 职场文书
2015年公司保安年终工作总结
2015/05/14 职场文书
2019年特色火锅店的创业计划书模板
2019/08/28 职场文书
mysql数据库如何转移到oracle
2022/12/24 MySQL