The GPG keys listed for the "MySQL 8.0 Community Server" repository are already installed but they are not correct for this package.
Check that the correct key URLs are configured for this repository.
Failing package is: mysql-community-libs-compat-8.0.34-1.el7.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
这个是由于GPG密钥验证问题引起的
解决方案
需要禁掉GPG验证检查
ls /etc/yum.repos.d/mysql-*
vi /etc/yum.repos.d/mysql-community.repo
找到[mysql80-community] 并修改:gpgcheck 改为 0 ,即不校验gpg
再次运行
yum install -y perl-DBD-mysql