CentOS Stream 9安装MySQL

首先参考下面安装的文章,然后其中的问题和解决方法写在后文中了。

博客园安装MySQL文章

问题

借鉴其中步骤,然后上面有个报错的地方,如下:

bash 复制代码
Import of key(s) didn't help, wrong key(s)?
Public key for mysql-community-client-8.0.44-1.el9.x86_64.rpm is not installed. Failing package is: mysql-community-client-8.0.44-1.el9.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
Public key for mysql-community-client-plugins-8.0.44-1.el9.x86_64.rpm is not installed. Failing package is: mysql-community-client-plugins-8.0.44-1.el9.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
Public key for mysql-community-common-8.0.44-1.el9.x86_64.rpm is not installed. Failing package is: mysql-community-common-8.0.44-1.el9.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
Public key for mysql-community-icu-data-files-8.0.44-1.el9.x86_64.rpm is not installed. Failing package is: mysql-community-icu-data-files-8.0.44-1.el9.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
Public key for mysql-community-libs-8.0.44-1.el9.x86_64.rpm is not installed. Failing package is: mysql-community-libs-8.0.44-1.el9.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
Public key for mysql-community-server-8.0.44-1.el9.x86_64.rpm is not installed. Failing package is: mysql-community-server-8.0.44-1.el9.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: GPG check FAILED

核心问题是MySQL 安装包的 GPG 公钥验证失败

解决方法

安装新的MySQL版本,去到官网 https://dev.mysql.com/downloads/repo/yum/

选择适合的版本,然后执行命令:

bash 复制代码
wget https://repo.mysql.com/mysql84-community-release-el9-2.noarch.rpm

这里说明一下命令里面的各个不同数字代表含义:

  • mysql80 和 mysql84 的区别
    mysql80:表示 MySQL 社区版的 8.0.x 系列,但可能是较早的小版本(例如 8.0.20 之前)。
    mysql84(或更高):表示 MySQL 社区版的 8.0.x 的更新版本(例如 8.0.30 或更高)。
    通常,数字越大,版本越新,包含的 bug 修复和功能改进越多。
    建议:
    如果你的系统是新安装的,建议选择 mysql84(即 MySQL 8.0 的较新版本),因为它包含更多的更新和修复。
  • el9 和 el10 的区别
    el9:对应 RHEL 9 或兼容系统(如 CentOS Stream 9)。
    el10:对应 RHEL 10 或兼容系统(目前 RHEL 10 尚未发布,可能是未来的版本)。
    系统是 CentOS Stream 9,所以应该选择 el9 的 RPM 包。
  • -2、-3 是什么意思
    这是 RPM 包的 发布版本号(release number),表示该 RPM 包的第几次构建或更新。
    例如,mysql84-community-release-el9-3.noarch 中的 -3 表示这是该包的第 3 次构建。
    通常,数字越大,表示该包越新,可能包含一些修复或改进。
    建议:
    选择最新的发布版本(即数字最大的包),例如 -3 比 -2 更新。

接着执行命令

bash 复制代码
 dnf install mysql-community-server -y

其他的如第一个链接一样。

相关推荐
那个村的李富贵1 小时前
解锁CANN仓库核心能力:50行代码搭建国产化AIGC图片风格迁移神器
mysql·信息可视化·aigc·cann
游戏开发爱好者82 小时前
日常开发与测试的 App 测试方法、查看设备状态、实时日志、应用数据
android·ios·小程序·https·uni-app·iphone·webview
王码码20352 小时前
Flutter for OpenHarmony 实战之基础组件:第三十一篇 Chip 系列组件 — 灵活的标签化交互
android·flutter·交互·harmonyos
黑码哥2 小时前
ViewHolder设计模式深度剖析:iOS开发者掌握Android列表性能优化的实战指南
android·ios·性能优化·跨平台开发·viewholder
亓才孓2 小时前
[JDBC]元数据
android
独行soc2 小时前
2026年渗透测试面试题总结-17(题目+回答)
android·网络·安全·web安全·渗透测试·安全狮
金融RPA机器人丨实在智能3 小时前
Android Studio开发App项目进入AI深水区:实在智能Agent引领无代码交互革命
android·人工智能·ai·android studio
科技块儿3 小时前
利用IP查询在智慧城市交通信号系统中的应用探索
android·tcp/ip·智慧城市
独行soc3 小时前
2026年渗透测试面试题总结-18(题目+回答)
android·网络·安全·web安全·渗透测试·安全狮
威迪斯特4 小时前
CentOS图形化操作界面:理论解析与实践指南
linux·运维·centos·组件·图形化·桌面·xserver