1、安装
1.查看yum列表,发现没有mysql
[root@server-mysql src]# yum list mysql
已加载插件:fastestmirror
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* extras: centos.ustc.edu.cn
* updates: centos.ustc.edu.cn
错误:没有匹配的软件包可以列出
2.使用wget下载一个mysql的repo源
[root@server-mysql src]# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
-bash: wget: 未找到命令
3.发现wget也没有,那就安装一个wget
[root@server-mysql src]# yum list wget
已加载插件:fastestmirror
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* extras: centos.ustc.edu.cn
* updates: centos.ustc.edu.cn
可安装的软件包
wget.x86_64 1.14-15.el7_4.1 base
[root@server-mysql src]# yum -y install wget.x86_64
......
依赖关系解决
========================================================================================
Package 架构 版本 源 大小
========================================================================================
正在安装:
wget x86_64 1.14-15.el7_4.1 base 547 k
事务概要
========================================================================================
安装 1 软件包
总下载量:547 k
安装大小:2.0 M
Downloading packages:
wget-1.14-15.el7_4.1.x86_64.rpm | 547 kB 00:00:10
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : wget-1.14-15.el7_4.1.x86_64 1/1
验证中 : wget-1.14-15.el7_4.1.x86_64 1/1
已安装:
wget.x86_64 0:1.14-15.el7_4.1
完毕!
4.在次下载mysql的repo源
[root@server-mysql src]# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
--2018-09-08 14:45:20-- http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
正在解析主机 repo.mysql.com (repo.mysql.com)... 104.124.241.153
正在连接 repo.mysql.com (repo.mysql.com)|104.124.241.153|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:6140 (6.0K) [application/x-redhat-package-manager]
正在保存至: “mysql-community-release-el7-5.noarch.rpm”
100%[========================================================>] 6,140 --.-K/s 用时 0.001s
2018-09-08 14:45:20 (8.39 MB/s) - 已保存 “mysql-community-release-el7-5.noarch.rpm” [6140/6140])
5.用命令查看当前目录,已经下载好了
[root@server-mysql src]# ll | grep mysql
-rw-r--r--. 1 root root 6140 11月 12 2015 mysql-community-release-el7-5.noarch.rpm
6.安装一下
[root@server-mysql src]# rpm -ivh mysql-community-release-el7-5.noarch.rpm
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-release-el7-5 ################################# [100%]
7.再次查看yum列表,发现已经有mysql的包了
[root@server-mysql src]# yum list mysql
已加载插件:fastestmirror
mysql-connectors-community | 2.5 kB 00:00:00
mysql-tools-community | 2.5 kB 00:00:00
mysql56-community | 2.5 kB 00:00:00
(1/3): mysql-connectors-community/x86_64/primary_db | 26 kB 00:00:00
(2/3): mysql-tools-community/x86_64/primary_db | 45 kB 00:00:00
8.执行安装(会替换自带的mariadb库)
[root@server-mysql src]# yum -y install mysql-server
已加载插件:fastestmirror
.......
已安装:
mysql-community-libs.x86_64 0:5.6.41-2.el7 mysql-community-server.x86_64 0:5.6.41-2.el7
作为依赖被安装:
mysql-community-client.x86_64 0:5.6.41-2.el7 mysql-community-common.x86_64 0:5.6.41-2.el7 net-tools.x86_64 0:2.0-0.22.20131004git.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-Data-Dumper.x86_64 0:2.145-3.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
替代:
mariadb-libs.x86_64 1:5.5.56-2.el7
完毕!
网友评论