操作系统最小化安装
安装步骤 1 检查系统是否有安装包和mysql源
yum install mysql-community-client mysql-community-server
实例:
[root@riyimei ~]# yum install mysql-community-client mysql-community-server
Loaded plugins: fastestmirror, versionlock
Determining fastest mirrors
* base: mirrors.ustc.edu.cn
* extras: mirrors.aliyun.com
* updates: mirrors.ustc.edu.cn
base | 3.6 kB 00:00:00
docker-ce-stable | 3.5 kB 00:00:00
epel | 4.7 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/6): epel/x86_64/group_gz | 96 kB 00:00:00
(2/6): docker-ce-stable/7/x86_64/primary_db | 75 kB 00:00:00
(3/6): epel/x86_64/updateinfo | 1.0 MB 00:00:02
(4/6): extras/7/x86_64/primary_db | 246 kB 00:00:03
(5/6): epel/x86_64/primary_db | 7.0 MB 00:00:12
(6/6): updates/7/x86_64/primary_db | 15 MB 00:00:20
Excluding 3 updates due to versionlock (use "yum versionlock status" to show them)
No package mysql-community-client available.
No package mysql-community-server available.
报错信息:
No package mysql-community-client available.
No package mysql-community-server available.
处理:添加mysql官方yum源 通过rpm包安装官方源
https://dev.mysql.com/downloads/repo/yum/
下载对应操作系统版本的rpm包
上传rpm包到系统
步骤2 安装MySQL yum源rpm包
mysql80-community-release-el7-6.noarch.rpm
查看文件和yum源
[root@riyimei ~]# ls -l
total 1357672
drwxr-xr-x. 2 root root 161 Nov 9 09:01 alpine
-rw-------. 1 root root 1405 Jul 8 2021 anaconda-ks.cfg
-rw-r--r--. 1 root root 1949 Jul 13 2021 docker.sh
-rw-r--r--. 1 root root 11288 Apr 28 12:30 mysql80-community-release-el7-6.noarch.rpm
-rw-------. 1 root root 130625536 Jul 19 2021 nginx.tag.gz
drwxr-xr-x. 3 root root 65 Jul 19 2021 node
-rw-------. 1 root root 932485632 Jul 19 2021 node.tag.gz
drwxr-xr-x. 4 root root 179 Dec 7 14:00 opsant
-rw-------. 1 root root 327122944 Jul 16 2021 seate-server.tag.gz
[root@riyimei ~]# ls -l /etc/yum.repos.d/
total 40
-rw-r--r--. 1 root root 1664 Nov 23 2018 CentOS-Base.repo
-rw-r--r--. 1 root root 1309 Nov 23 2018 CentOS-CR.repo
-rw-r--r--. 1 root root 649 Nov 23 2018 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 314 Nov 23 2018 CentOS-fasttrack.repo
-rw-r--r--. 1 root root 630 Nov 23 2018 CentOS-Media.repo
-rw-r--r--. 1 root root 1331 Nov 23 2018 CentOS-Sources.repo
-rw-r--r--. 1 root root 5701 Nov 23 2018 CentOS-Vault.repo
-rw-r--r--. 1 root root 2081 Dec 7 13:24 docker-ce.repo
-rw-r--r--. 1 root root 664 Dec 7 13:24 epel.repo
安装mysql yum源
[root@riyimei ~]# rpm -ivh mysql80-community-release-el7-6.noarch.rpm
warning: mysql80-community-release-el7-6.noarch.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:mysql80-community-release-el7-6 ################################# [100%]
检查yum源和更新 yum repolist
[root@riyimei ~]# yum repolist
Loaded plugins: fastestmirror, versionlock
Loading mirror speeds from cached hostfile
* base: mirrors.ustc.edu.cn
* extras: mirrors.aliyun.com
* updates: mirrors.ustc.edu.cn
mysql-connectors-community | 2.6 kB 00:00:00
mysql-tools-community | 2.6 kB 00:00:00
mysql80-community | 2.6 kB 00:00:00
(1/3): mysql-tools-community/x86_64/primary_db | 86 kB 00:00:01
(2/3): mysql80-community/x86_64/primary_db | 211 kB 00:00:03
(3/3): mysql-connectors-community/x86_64/primary_db | 87 kB 00:00:07
Excluding 3 updates due to versionlock (use "yum versionlock status" to show them)
repo id repo name status
base/7/x86_64 CentOS-7 - Base 10,072
docker-ce-stable/7/x86_64 Docker CE Stable - x86_64 150
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 13,751
extras/7/x86_64 CentOS-7 - Extras 509
mysql-connectors-community/x86_64 MySQL Connectors Community 192
mysql-tools-community/x86_64 MySQL Tools Community 90
mysql80-community/x86_64 MySQL 8.0 Community Server 343
updates/7/x86_64 CentOS-7 - Updates 3,728
repolist: 28,835
步骤3 yum安装mysql
[root@riyimei ~]# yum install mysql-community-client mysql-community-server
Loaded plugins: fastestmirror, versionlock
Loading mirror speeds from cached hostfile
* base: mirrors.ustc.edu.cn
* extras: mirrors.aliyun.com
* updates: mirrors.ustc.edu.cn
Excluding 3 updates due to versionlock (use "yum versionlock status" to show them)
Resolving Dependencies
--> Running transaction check
---> Package mariadb.x86_64 1:5.5.68-1.el7 will be obsoleted
---> Package mysql-community-client.x86_64 0:8.0.29-1.el7 will be obsoleting
--> Processing Dependency: mysql-community-client-plugins = 8.0.29-1.el7 for package: mysql-community-client-8.0.29-1.el7.x86_64
--> Processing Dependency: mysql-community-libs(x86-64) >= 8.0.11 for package: mysql-community-client-8.0.29-1.el7.x86_64
---> Package mysql-community-server.x86_64 0:8.0.29-1.el7 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 8.0.29-1.el7 for package: mysql-community-server-8.0.29-1.el7.x86_64
--> Processing Dependency: mysql-community-icu-data-files = 8.0.29-1.el7 for package: mysql-community-server-8.0.29-1.el7.x86_64
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.68-1.el7 will be obsoleted
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-7.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-7.el7.x86_64
---> Package mysql-community-client-plugins.x86_64 0:8.0.29-1.el7 will be installed
---> Package mysql-community-common.x86_64 0:8.0.29-1.el7 will be installed
---> Package mysql-community-icu-data-files.x86_64 0:8.0.29-1.el7 will be installed
---> Package mysql-community-libs.x86_64 0:8.0.29-1.el7 will be obsoleting
--> Running transaction check
---> Package mysql-community-libs-compat.x86_64 0:8.0.29-1.el7 will be obsoleting
---> Package postfix.x86_64 2:2.10.1-7.el7 will be updated
---> Package postfix.x86_64 2:2.10.1-9.el7 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
============================================================================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================================================================
Installing:
mysql-community-client x86_64 8.0.29-1.el7 mysql80-community 14 M
replacing mariadb.x86_64 1:5.5.68-1.el7
mysql-community-libs x86_64 8.0.29-1.el7 mysql80-community 1.5 M
replacing mariadb-libs.x86_64 1:5.5.68-1.el7
mysql-community-libs-compat x86_64 8.0.29-1.el7 mysql80-community 667 k
replacing mariadb-libs.x86_64 1:5.5.68-1.el7
mysql-community-server x86_64 8.0.29-1.el7 mysql80-community 53 M
Installing for dependencies:
mysql-community-client-plugins x86_64 8.0.29-1.el7 mysql80-community 2.5 M
mysql-community-common x86_64 8.0.29-1.el7 mysql80-community 633 k
mysql-community-icu-data-files x86_64 8.0.29-1.el7 mysql80-community 2.1 M
Updating for dependencies:
postfix x86_64 2:2.10.1-9.el7 base 2.4 M
Transaction Summary
============================================================================================================================================================================================
Install 4 Packages (+3 Dependent packages)
Upgrade ( 1 Dependent package)
Total download size: 77 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
warning: /var/cache/yum/x86_64/7/mysql80-community/packages/mysql-community-client-plugins-8.0.29-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY MB 00:03:52 ETA
Public key for mysql-community-client-plugins-8.0.29-1.el7.x86_64.rpm is not installed
(1/8): mysql-community-client-plugins-8.0.29-1.el7.x86_64.rpm | 2.5 MB 00:00:14
(2/8): mysql-community-common-8.0.29-1.el7.x86_64.rpm | 633 kB 00:00:04
(3/8): mysql-community-icu-data-files-8.0.29-1.el7.x86_64.rpm | 2.1 MB 00:00:13
(4/8): mysql-community-libs-8.0.29-1.el7.x86_64.rpm | 1.5 MB 00:00:11
(5/8): mysql-community-libs-compat-8.0.29-1.el7.x86_64.rpm | 667 kB 00:00:07
(6/8): postfix-2.10.1-9.el7.x86_64.rpm | 2.4 MB 00:00:02
(7/8): mysql-community-client-8.0.29-1.el7.x86_64.rpm 37% [=========================- ] 56 kB/s | 29 MB 00:14:40 ETA
Channel(Socket) closed from remote host(192.168.31.140:22) at 12:35:44.