如果您尝试在使用 Amazon Linux 2023 的 EC2 实例上安装 MySQL,您可能会遇到与 GPG 密钥相关的烦人错误:
The GPG keys listed for the "MySQL 8.0 Community Server" repository are already installed but they are not correct for this package.
发生这种情况是因为 MySQL 最近更新了其 GPG 密钥,并且某些版本的存储库尝试使用过时的密钥。以下是解决此问题的方法以及发生此问题的原因。
什么原因导致此错误?
GPG 密钥用于验证下载包的完整性和真实性。但是,旧的 RPM-GPG-KEY-mysql-2022 密钥已于 2023 年 12 月 14 日 过期,较新的软件包(从 MySQL 8.0.36 开始)现在需要新的 RPM-KEY-。 mysql-2023
因此,即使存储库自动配置了旧密钥,它也无法验证较新的包。
如何解决错误
按照以下步骤导入新的 GPG 密钥并完成 MySQL 安装。
1。删除过时的 GPG 密钥
请务必删除任何可能导致冲突的旧密钥。
sudo rpm -e gpg-pubkey-3a79bd29
注意:3a79bd29 是旧密钥。如果您在错误消息中看到另一个冲突的键,请将其替换为相应的标识符。
2。导入 2023 年的新 GPG 密钥
下载并手动导入新的 GPG 密钥:
sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2023
3。重试 MySQL 安装
现在您可以毫无问题地重新安装 MySQL:
sudo yum install mysql-community-server -y
检查活动密钥
要确认是否安装了正确的密钥,请使用以下命令:
rpm -qa gpg-pubkey
您应该看到类似以下内容:
gpg-pubkey-a8d3785c-<timestamp> </timestamp>
标识符 a8d3785c 对应于对最近的 MySQL 软件包有效的新 GPG 密钥。
展望未来
根据 MySQL 错误报告,这些密钥会定期更新。这是很好的做法:
- 请务必查阅发行说明或官方 MySQL 文档。
- 在安装或更新软件包之前验证 GPG 密钥的有效性。
结论
这个问题可能看起来令人沮丧,但现在您知道如何解决它,您将能够在运行 Amazon Linux 2023 的 EC2 实例上安装 MySQL,不会出现任何问题。
如果您有任何疑问或遇到其他错误,请在评论中留言!我是来帮助你的。 ?
以上是在 Amazon Linux 3 上安装 MySQL 时如何修复'GPG 密钥已安装”错误?的详细内容。更多信息请关注PHP中文网其他相关文章!

mysqlviewshavelimitations:1)他们不使用Supportallsqloperations,限制DatamanipulationThroughViewSwithJoinSorsubqueries.2)他们canimpactperformance,尤其是withcomplexcomplexclexeriesorlargedatasets.3)

porthusermanagementInmysqliscialforenhancingsEcurityAndsingsmenting效率databaseoperation.1)usecReateusertoAddusers,指定connectionsourcewith@'localhost'or@'%'。

mysqldoes notimposeahardlimitontriggers,butacticalfactorsdeterminetheireffactective:1)serverConfiguration impactactStriggerGermanagement; 2)复杂的TriggerSincreaseSySystemsystem load; 3)largertablesslowtriggerperfermance; 4)highConconcConcrencerCancancancancanceTigrignecentign; 5); 5)

Yes,it'ssafetostoreBLOBdatainMySQL,butconsiderthesefactors:1)StorageSpace:BLOBscanconsumesignificantspace,potentiallyincreasingcostsandslowingperformance.2)Performance:LargerrowsizesduetoBLOBsmayslowdownqueries.3)BackupandRecovery:Theseprocessescanbe

通过PHP网页界面添加MySQL用户可以使用MySQLi扩展。步骤如下:1.连接MySQL数据库,使用MySQLi扩展。2.创建用户,使用CREATEUSER语句,并使用PASSWORD()函数加密密码。3.防止SQL注入,使用mysqli_real_escape_string()函数处理用户输入。4.为新用户分配权限,使用GRANT语句。

mysql'sblobissuitableForStoringBinaryDataWithInareLationalDatabase,而alenosqloptionslikemongodb,redis和calablesolutionsoluntionsoluntionsoluntionsolundortionsolunsolunsstructureddata.blobobobsimplobissimplobisslowderperformandperformanceperformancewithlararengelitiate;

toaddauserinmysql,使用:createUser'username'@'host'Indessify'password'; there'showtodoitsecurely:1)choosethehostcarecarefullytocon trolaccess.2)setResourcelimitswithoptionslikemax_queries_per_hour.3)usestrong,iniquepasswords.4)Enforcessl/tlsconnectionswith

toAvoidCommonMistakeswithStringDatatatPesInMysQl,CloseStringTypenuances,chosethirtightType,andManageEngencodingAndCollationsEttingsefectery.1)usecharforfixed lengengters lengengtings,varchar forbariaible lengength,varchariable length,andtext/blobforlabforlargerdata.2 seterters seterters seterters seterters


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

Video Face Swap
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

EditPlus 中文破解版
体积小,语法高亮,不支持代码提示功能

SublimeText3 英文版
推荐:为Win版本,支持代码提示!

螳螂BT
Mantis是一个易于部署的基于Web的缺陷跟踪工具,用于帮助产品缺陷跟踪。它需要PHP、MySQL和一个Web服务器。请查看我们的演示和托管服务。

SublimeText3 Linux新版
SublimeText3 Linux最新版

SecLists
SecLists是最终安全测试人员的伙伴。它是一个包含各种类型列表的集合,这些列表在安全评估过程中经常使用,都在一个地方。SecLists通过方便地提供安全测试人员可能需要的所有列表,帮助提高安全测试的效率和生产力。列表类型包括用户名、密码、URL、模糊测试有效载荷、敏感数据模式、Web shell等等。测试人员只需将此存储库拉到新的测试机上,他就可以访问到所需的每种类型的列表。