CenterOS7.6中解决No package mysql-server available.
1.使用yum install mysql mysql-server mysql-devel -y报错如下:# yum install mysql mysql-server mysql-devel -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
No package mysql-server available.
Resolving Dependencies
--> Running transaction check
---> Package mariadb.x86_64 1:5.5.68-1.el7 will be installed
---> Package mariadb-devel.x86_64 1:5.5.68-1.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================
Installing:
mariadb x86_64 1:5.5.68-1.el7 os 8.8 M
mariadb-devel x86_64 1:5.5.68-1.el7 os 757 k
Transaction Summary
=============================================================================================================================
Install2 Packages
Total download size: 9.5 M
Installed size: 52 M
Downloading packages:
(1/2): mariadb-devel-5.5.68-1.el7.x86_64.rpm | 757 kB00:00:00
(2/2): mariadb-5.5.68-1.el7.x86_64.rpm | 8.8 MB00:00:01
-----------------------------------------------------------------------------------------------------------------------------
Total 8.1 MB/s | 9.5 MB00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:mariadb-5.5.68-1.el7.x86_64 1/2
Installing : 1:mariadb-devel-5.5.68-1.el7.x86_64 2/2
Verifying: 1:mariadb-devel-5.5.68-1.el7.x86_64 1/2
Verifying: 1:mariadb-5.5.68-1.el7.x86_64 2/2
Installed:
mariadb.x86_64 1:5.5.68-1.el7 mariadb-devel.x86_64 1:5.5.68-1.el7
Complete!
2.解决方法如下:
1: wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
2: rpm -ivh mysql-community-release-el7-5.noarch.rpm
执行效果如下:
# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
--2021-12-22 23:48:16--http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
Resolving repo.mysql.com (repo.mysql.com)... 104.124.193.119
Connecting to repo.mysql.com (repo.mysql.com)|104.124.193.119|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6140 (6.0K)
Saving to: ‘mysql-community-release-el7-5.noarch.rpm’
100%[===================================================================================>] 6,140 23.9KB/s in 0.3s
2021-12-22 23:48:17 (23.9 KB/s) - ‘mysql-community-release-el7-5.noarch.rpm’ saved
# rpm -ivh mysql-community-release-el7-5.noarch.rpm
Preparing... #################################
Updating / installing...
1:mysql-community-release-el7-5 #################################
3.接着在执行安装
# yum install mysql mysql-server mysql-devel -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
mysql-connectors-community | 2.6 kB00:00:00
mysql-tools-community | 2.6 kB00:00:00
mysql56-community | 2.6 kB00:00:00
(1/3): mysql-connectors-community/x86_64/primary_db |87 kB00:00:01
(2/3): mysql-tools-community/x86_64/primary_db |92 kB00:00:01
(3/3): mysql56-community/x86_64/primary_db | 297 kB00:00:02
Resolving Dependencies
--> Running transaction check
---> Package mariadb.x86_64 1:5.5.68-1.el7 will be obsoleted
---> Package mariadb-devel.x86_64 1:5.5.68-1.el7 will be obsoleted
---> Package mysql-community-client.x86_64 0:5.6.51-2.el7 will be obsoleting
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.6.10 for package: mysql-community-client-5.6.51-2.el7.x86_64
---> Package mysql-community-devel.x86_64 0:5.6.51-2.el7 will be obsoleting
---> Package mysql-community-server.x86_64 0:5.6.51-2.el7 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.6.51-2.el7 for package: mysql-community-server-5.6.51-2.el7.x86_64
--> Processing Dependency: perl(DBI) for package: mysql-community-server-5.6.51-2.el7.x86_64
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.68-1.el7 will be obsoleted
---> Package mysql-community-common.x86_64 0:5.6.51-2.el7 will be installed
---> Package mysql-community-libs.x86_64 0:5.6.51-2.el7 will be obsoleting
---> Package perl-DBI.x86_64 0:1.627-4.el7 will be installed
--> Processing Dependency: perl(RPC::PlServer) >= 0.2001 for package: perl-DBI-1.627-4.el7.x86_64
--> Processing Dependency: perl(RPC::PlClient) >= 0.2000 for package: perl-DBI-1.627-4.el7.x86_64
--> Running transaction check
---> Package perl-PlRPC.noarch 0:0.2020-14.el7 will be installed
--> Processing Dependency: perl(Net::Daemon) >= 0.13 for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Test) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Log) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Compress::Zlib) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Running transaction check
---> Package perl-IO-Compress.noarch 0:2.061-2.el7 will be installed
--> Processing Dependency: perl(Compress::Raw::Zlib) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
--> Processing Dependency: perl(Compress::Raw::Bzip2) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
---> Package perl-Net-Daemon.noarch 0:0.48-5.el7 will be installed
--> Running transaction check
---> Package perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 will be installed
---> Package perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================
Installing:
mysql-community-client x86_64 5.6.51-2.el7 mysql56-community 21 M
replacingmariadb.x86_64 1:5.5.68-1.el7
mysql-community-devel x86_64 5.6.51-2.el7 mysql56-community 3.4 M
replacingmariadb-devel.x86_64 1:5.5.68-1.el7
mysql-community-libs x86_64 5.6.51-2.el7 mysql56-community 2.2 M
replacingmariadb-libs.x86_64 1:5.5.68-1.el7
mysql-community-server x86_64 5.6.51-2.el7 mysql56-community 67 M
Installing for dependencies:
mysql-community-common x86_64 5.6.51-2.el7 mysql56-community 287 k
perl-Compress-Raw-Bzip2 x86_64 2.061-3.el7 os 32 k
perl-Compress-Raw-Zlib x86_64 1:2.061-4.el7 os 57 k
perl-DBI x86_64 1.627-4.el7 os 802 k
perl-IO-Compress noarch 2.061-2.el7 os 260 k
perl-Net-Daemon noarch 0.48-5.el7 os 51 k
perl-PlRPC noarch 0.2020-14.el7 os 36 k
Transaction Summary
=============================================================================================================================
Install4 Packages (+7 Dependent packages)
Total download size: 94 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/mysql56-community/packages/mysql-community-common-5.6.51-2.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Public key for mysql-community-common-5.6.51-2.el7.x86_64.rpm is not installed
(1/11): mysql-community-common-5.6.51-2.el7.x86_64.rpm | 287 kB00:00:02
(2/11): mysql-community-devel-5.6.51-2.el7.x86_64.rpm | 3.4 MB00:00:03
(3/11): mysql-community-libs-5.6.51-2.el7.x86_64.rpm | 2.2 MB00:00:02
(4/11): perl-Compress-Raw-Zlib-2.061-4.el7.x86_64.rpm |57 kB00:00:00
(5/11): perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64.rpm |32 kB00:00:00
(6/11): perl-IO-Compress-2.061-2.el7.noarch.rpm | 260 kB00:00:00
(7/11): perl-DBI-1.627-4.el7.x86_64.rpm | 802 kB00:00:00
(8/11): perl-Net-Daemon-0.48-5.el7.noarch.rpm |51 kB00:00:00
(9/11): perl-PlRPC-0.2020-14.el7.noarch.rpm |36 kB00:00:00
(10/11): mysql-community-server-5.6.51-2.el7.x86_64.rpm |67 MB00:01:28
(11/11): mysql-community-client-5.6.51-2.el7.x86_64.rpm |21 MB00:02:08
-----------------------------------------------------------------------------------------------------------------------------
Total 754 kB/s |94 MB00:02:08
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 : mysql-community-release-el7-5.noarch (installed)
From : file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Installing : mysql-community-common-5.6.51-2.el7.x86_64 1/14
Installing : mysql-community-libs-5.6.51-2.el7.x86_64 2/14
Installing : mysql-community-client-5.6.51-2.el7.x86_64 3/14
Installing : perl-Net-Daemon-0.48-5.el7.noarch 4/14
Installing : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 5/14
Installing : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 6/14
Installing : perl-IO-Compress-2.061-2.el7.noarch 7/14
Installing : perl-PlRPC-0.2020-14.el7.noarch 8/14
Installing : perl-DBI-1.627-4.el7.x86_64 9/14
Installing : mysql-community-server-5.6.51-2.el7.x86_64 10/14
Installing : mysql-community-devel-5.6.51-2.el7.x86_64 11/14
Erasing : 1:mariadb-devel-5.5.68-1.el7.x86_64 12/14
Erasing : 1:mariadb-5.5.68-1.el7.x86_64 13/14
Erasing : 1:mariadb-libs-5.5.68-1.el7.x86_64 14/14
Verifying: perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 1/14
Verifying: mysql-community-libs-5.6.51-2.el7.x86_64 2/14
Verifying: mysql-community-server-5.6.51-2.el7.x86_64 3/14
Verifying: 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 4/14
Verifying: mysql-community-common-5.6.51-2.el7.x86_64 5/14
Verifying: perl-PlRPC-0.2020-14.el7.noarch 6/14
Verifying: perl-Net-Daemon-0.48-5.el7.noarch 7/14
Verifying: perl-DBI-1.627-4.el7.x86_64 8/14
Verifying: perl-IO-Compress-2.061-2.el7.noarch 9/14
Verifying: mysql-community-devel-5.6.51-2.el7.x86_64 10/14
Verifying: mysql-community-client-5.6.51-2.el7.x86_64 11/14
Verifying: 1:mariadb-devel-5.5.68-1.el7.x86_64 12/14
Verifying: 1:mariadb-libs-5.5.68-1.el7.x86_64 13/14
Verifying: 1:mariadb-5.5.68-1.el7.x86_64 14/14
Installed:
mysql-community-client.x86_64 0:5.6.51-2.el7 mysql-community-devel.x86_64 0:5.6.51-2.el7
mysql-community-libs.x86_64 0:5.6.51-2.el7 mysql-community-server.x86_64 0:5.6.51-2.el7
Dependency Installed:
mysql-community-common.x86_64 0:5.6.51-2.el7 perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7
perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 perl-DBI.x86_64 0:1.627-4.el7
perl-IO-Compress.noarch 0:2.061-2.el7 perl-Net-Daemon.noarch 0:0.48-5.el7
perl-PlRPC.noarch 0:0.2020-14.el7
Replaced:
mariadb.x86_64 1:5.5.68-1.el7 mariadb-devel.x86_64 1:5.5.68-1.el7 mariadb-libs.x86_64 1:5.5.68-1.el7
Complete!
成功安装!
真是被感动的痛哭流涕…… 看到这帖子真是高兴! 强烈支持楼主ing…… 淡定,淡定,淡定…… 我只是路过打酱油的。 真是难得给力的帖子啊。 感恩无私的分享与奉献 :) 激动人心,无法言表! 楼主加油,我们都看好你哦。