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配置SSL证书出错解决方案
Mar 31 Servers
Nginx配置80端口访问8080及项目名地址方法解析
Mar 31 Servers
Nginx Rewrite使用场景及配置方法解析
Apr 01 Servers
解析在浏览器地址栏输入一个URL后发生了什么
Jun 21 Servers
Dashboard管理Kubernetes集群与API访问配置
Apr 01 Servers
忘记Grafana不要紧2种Grafana重置admin密码方法详细步骤
Apr 07 Servers
Tomcat项目启动失败的原因和解决办法
Apr 20 Servers
详解Nginx的超时keeplive_timeout配置步骤
May 25 Servers
讨论nginx location 顺序问题
May 30 Servers
windows server2008 开启端口的实现方法
Jun 25 Servers
Zabbix对Kafka topic积压数据监控的解决方案
Jul 07 Servers
Nginx使用ngx_http_upstream_module实现负载均衡功能示例
Aug 05 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图片等比缩放类SimpleImage使用方法和使用实例分享
2014/04/10 PHP
PHP环形链表实现方法示例
2017/09/15 PHP
phpQuery采集网页实现代码实例
2020/04/02 PHP
Ext JS添加子组件的误区探讨
2013/06/28 Javascript
模拟用户点击弹出新页面不会被浏览器拦截
2014/04/08 Javascript
nodejs中sleep功能实现暂停几秒的方法
2017/07/12 NodeJs
基于jQuery的左滑出现删除按钮的示例
2017/08/29 jQuery
关于axios如何全局注册浅析
2018/01/14 Javascript
AnglarJs中的上拉加载实现代码
2018/02/08 Javascript
angularJS的radio实现单项二选一的使用方法
2018/02/28 Javascript
详解JS判断页面是在手机端还是在PC端打开的方法
2019/04/26 Javascript
Vue侦测相关api的实现方法
2019/05/22 Javascript
WebSocket的简单介绍及应用
2019/05/23 Javascript
[49:18]2018DOTA2亚洲邀请赛 3.31 小组赛 A组 OG vs TNC
2018/04/01 DOTA
python实现360的字符显示界面
2014/02/21 Python
python通过scapy获取局域网所有主机mac地址示例
2014/05/04 Python
以一段代码为实例快速入门Python2.7
2015/03/31 Python
Python中decorator使用实例
2015/04/14 Python
Python3的urllib.parse常用函数小结(urlencode,quote,quote_plus,unquote,unquote_plus等)
2016/09/18 Python
利用Python画ROC曲线和AUC值计算
2016/09/19 Python
对numpy中数组元素的统一赋值实例
2018/04/04 Python
对python pandas 画移动平均线的方法详解
2018/11/28 Python
python提取具有某种特定字符串的行数据方法
2018/12/11 Python
Python图像处理库PIL的ImageFilter模块使用介绍
2020/02/26 Python
python实现密度聚类(模板代码+sklearn代码)
2020/04/27 Python
Python使用paramiko连接远程服务器执行Shell命令的实现
2021/03/04 Python
用CSS3实现Win8风格的方格导航菜单效果
2013/04/10 HTML / CSS
Staples美国官方网站:办公用品一站式采购
2016/07/28 全球购物
SportsDirect.com新加坡:英国第一体育零售商
2019/03/30 全球购物
乌克兰电子产品和家用电器购物网站:TOUCH
2019/08/09 全球购物
行政助理求职自荐信
2013/10/26 职场文书
保证书范文大全
2014/04/28 职场文书
护士2014年终工作总结
2014/11/11 职场文书
2014年人事工作总结范文
2014/11/19 职场文书
SpringBoot使用ip2region获取地理位置信息的方法
2022/06/21 Java/Android
python自动获取微信公众号最新文章的实现代码
2022/07/15 Python