centos7安装mysql5.7的踩坑记录
来源:脚本之家
时间:2023-01-07 11:46:08 237浏览 收藏
对于一个数据库开发者来说,牢固扎实的基础是十分重要的,golang学习网就来带大家一点点的掌握基础知识点。今天本篇文章带大家了解《centos7安装mysql5.7的踩坑记录》,主要介绍了mysql5.7、CentOS7安装,希望对大家的知识积累有所帮助,快点收藏起来吧,否则需要时就找不到了!
今天使用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" 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的踩坑记录》的内容了。个人认为,基础知识的学习和巩固,是为了更好的将其运用到项目中,欢迎关注golang学习网公众号,带你了解更多关于mysql的知识点!
声明:本文转载于:脚本之家 如有侵犯,请联系study_golang@163.com删除
相关阅读
更多>
-
392 收藏
-
464 收藏
-
367 收藏
-
385 收藏
-
367 收藏
最新阅读
更多>
-
420 收藏
-
165 收藏
-
397 收藏
-
489 收藏
-
209 收藏
-
497 收藏
课程推荐
更多>
-
- 前端进阶之JavaScript设计模式
- 设计模式是开发人员在软件开发过程中面临一般问题时的解决方案,代表了最佳的实践。本课程的主打内容包括JS常见设计模式以及具体应用场景,打造一站式知识长龙服务,适合有JS基础的同学学习。
- 立即学习 542次学习
-
- GO语言核心编程课程
- 本课程采用真实案例,全面具体可落地,从理论到实践,一步一步将GO核心编程技术、编程思想、底层实现融会贯通,使学习者贴近时代脉搏,做IT互联网时代的弄潮儿。
- 立即学习 507次学习
-
- 简单聊聊mysql8与网络通信
- 如有问题加微信:Le-studyg;在课程中,我们将首先介绍MySQL8的新特性,包括性能优化、安全增强、新数据类型等,帮助学生快速熟悉MySQL8的最新功能。接着,我们将深入解析MySQL的网络通信机制,包括协议、连接管理、数据传输等,让
- 立即学习 497次学习
-
- JavaScript正则表达式基础与实战
- 在任何一门编程语言中,正则表达式,都是一项重要的知识,它提供了高效的字符串匹配与捕获机制,可以极大的简化程序设计。
- 立即学习 487次学习
-
- 从零制作响应式网站—Grid布局
- 本系列教程将展示从零制作一个假想的网络科技公司官网,分为导航,轮播,关于我们,成功案例,服务流程,团队介绍,数据部分,公司动态,底部信息等内容区块。网站整体采用CSSGrid布局,支持响应式,有流畅过渡和展现动画。
- 立即学习 484次学习