1.使用yum install mysql mysql-server mysql-devel -y报错如下:
- [root@VM-4-9-centos ~]# 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
- =============================================================================================================================
- Install 2 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 kB 00:00:00
- (2/2): mariadb-5.5.68-1.el7.x86_64.rpm | 8.8 MB 00:00:01
- -----------------------------------------------------------------------------------------------------------------------------
- Total 8.1 MB/s | 9.5 MB 00: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
复制代码
执行效果如下:
- [root@VM-4-9-centos ~]# 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) [application/x-redhat-package-manager]
- 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 [6140/6140]
- [root@VM-4-9-centos ~]# rpm -ivh mysql-community-release-el7-5.noarch.rpm
- Preparing... ################################# [100%]
- Updating / installing...
- 1:mysql-community-release-el7-5 ################################# [100%]
复制代码
3.接着在执行安装
成功安装!
|
|