下载安装包
[root@c7 ~]# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
--2019-04-17 09:19:14-- http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
正在解析主机 dev.mysql.com (dev.mysql.com)... 137.254.60.11
正在连接 dev.mysql.com (dev.mysql.com)|137.254.60.11|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 301 Moved Permanently
位置:https://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm [跟随至新的 URL]
--2019-04-17 09:19:15-- https://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
正在连接 dev.mysql.com (dev.mysql.com)|137.254.60.11|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 302 Found
位置:https://repo.mysql.com//mysql-community-release-el7-5.noarch.rpm [跟随至新的 URL]
--2019-04-17 09:19:16-- https://repo.mysql.com//mysql-community-release-el7-5.noarch.rpm
正在解析主机 repo.mysql.com (repo.mysql.com)... 104.86.185.42
正在连接 repo.mysql.com (repo.mysql.com)|104.86.185.42|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:6140 (6.0K) [application/x-redhat-package-manager]
正在保存至: “mysql-community-release-el7-5.noarch.rpm”
100%[=========================================================================================================================>] 6,140 --.-K/s 用时 0s
2019-04-17 09:19:16 (440 MB/s) - 已保存 “mysql-community-release-el7-5.noarch.rpm” [6140/6140])
解压安装包
[root@c7 ~]# rpm -ivh mysql-community-release-el7-5.noarch.rpm
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-release-el7-5 ################################# [100%]
开始安装:
[root@c7 ~]# yum -y install mysql mysql-server mysql-devel
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.nwsuaf.edu.cn
正在解决依赖关系
--> 正在检查事务
---> 软件包 mariadb.x86_64.1.5.5.60-1.el7_5 将被 取代
---> 软件包 mariadb-devel.x86_64.1.5.5.60-1.el7_5 将被 取代
---> 软件包 mysql-community-client.x86_64.0.5.6.43-2.el7 将被 舍弃
--> 正在处理依赖关系 mysql-community-libs(x86-64) >= 5.6.10,它被软件包 mysql-community-client-5.6.43-2.el7.x86_64 需要
---> 软件包 mysql-community-devel.x86_64.0.5.6.43-2.el7 将被 舍弃
---> 软件包 mysql-community-server.x86_64.0.5.6.43-2.el7 将被 安装
--> 正在处理依赖关系 mysql-community-common(x86-64) = 5.6.43-2.el7,它被软件包 mysql-community-server-5.6.43-2.el7.x86_64 需要
--> 正在检查事务
---> 软件包 mariadb-libs.x86_64.1.5.5.60-1.el7_5 将被 取代
---> 软件包 mysql-community-common.x86_64.0.5.6.43-2.el7 将被 安装
---> 软件包 mysql-community-libs.x86_64.0.5.6.43-2.el7 将被 舍弃
--> 解决依赖关系完成
依赖关系解决
===================================================================================================================================================================
Package 架构 版本 源 大小
===================================================================================================================================================================
正在安装:
mysql-community-client x86_64 5.6.43-2.el7 mysql56-community 20 M
替换 mariadb.x86_64 1:5.5.60-1.el7_5
mysql-community-devel x86_64 5.6.43-2.el7 mysql56-community 3.4 M
替换 mariadb-devel.x86_64 1:5.5.60-1.el7_5
mysql-community-libs x86_64 5.6.43-2.el7 mysql56-community 2.0 M
替换 mariadb-libs.x86_64 1:5.5.60-1.el7_5
mysql-community-server x86_64 5.6.43-2.el7 mysql56-community 59 M
为依赖而安装:
mysql-community-common x86_64 5.6.43-2.el7 mysql56-community 257 k
事务概要
===================================================================================================================================================================
安装 4 软件包 (+1 依赖软件包)
总下载量:85 M
Downloading packages:
警告:/var/cache/yum/x86_64/7/mysql56-community/packages/mysql-community-common-5.6.43-2.el7.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY--:-- ETA
mysql-community-common-5.6.43-2.el7.x86_64.rpm 的公钥尚未安装
(1/5): mysql-community-common-5.6.43-2.el7.x86_64.rpm | 257 kB 00:00:00
(2/5): mysql-community-devel-5.6.43-2.el7.x86_64.rpm | 3.4 MB 00:00:16
(3/5): mysql-community-libs-5.6.43-2.el7.x86_64.rpm | 2.0 MB 00:00:03
(4/5): mysql-community-client-5.6.43-2.el7.x86_64.rpm | 20 MB 00:00:22
(5/5): mysql-community-server-5.6.43-2.el7.x86_64.rpm | 59 MB 00:00:52
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
总计 1.1 MB/s | 85 MB 00:01:14
从 file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql 检索密钥
导入 GPG key 0x5072E1F5:
用户ID : "MySQL Release Engineering <[email protected]>"
指纹 : a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5
软件包 : mysql-community-release-el7-5.noarch (installed)
来自 : file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
警告:RPM 数据库已被非 yum 程序修改。
正在安装 : mysql-community-common-5.6.43-2.el7.x86_64 1/8
正在安装 : mysql-community-libs-5.6.43-2.el7.x86_64 2/8
正在安装 : mysql-community-client-5.6.43-2.el7.x86_64 3/8
正在安装 : mysql-community-server-5.6.43-2.el7.x86_64 4/8
正在安装 : mysql-community-devel-5.6.43-2.el7.x86_64 5/8
正在删除 : 1:mariadb-devel-5.5.60-1.el7_5.x86_64 6/8
正在删除 : 1:mariadb-5.5.60-1.el7_5.x86_64 7/8
正在删除 : 1:mariadb-libs-5.5.60-1.el7_5.x86_64 8/8
验证中 : mysql-community-libs-5.6.43-2.el7.x86_64 1/8
验证中 : mysql-community-common-5.6.43-2.el7.x86_64 2/8
验证中 : mysql-community-server-5.6.43-2.el7.x86_64 3/8
验证中 : mysql-community-devel-5.6.43-2.el7.x86_64 4/8
验证中 : mysql-community-client-5.6.43-2.el7.x86_64 5/8
验证中 : 1:mariadb-libs-5.5.60-1.el7_5.x86_64 6/8
验证中 : 1:mariadb-5.5.60-1.el7_5.x86_64 7/8
验证中 : 1:mariadb-devel-5.5.60-1.el7_5.x86_64 8/8
已安装:
mysql-community-client.x86_64 0:5.6.43-2.el7 mysql-community-devel.x86_64 0:5.6.43-2.el7 mysql-community-libs.x86_64 0:5.6.43-2.el7
mysql-community-server.x86_64 0:5.6.43-2.el7
作为依赖被安装:
mysql-community-common.x86_64 0:5.6.43-2.el7
替代:
mariadb.x86_64 1:5.5.60-1.el7_5 mariadb-devel.x86_64 1:5.5.60-1.el7_5 mariadb-libs.x86_64 1:5.5.60-1.el7_5
完毕!
启动服务
[root@c7 ~]# service mysqld start
Redirecting to /bin/systemctl start mysqld.service
客户端连接,退出
[root@c7 ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.43 MySQL Community Server (GPL)
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> exit
Bye