Centos6下通过Yum Repository安装MySQL8.0

通过Yum Repository安装MySQL8.0

安装Yum Repository


## Centos6下下载:
wget https://repo.mysql.com//mysql80-community-release-el6-3.noarch.rpm

## Centos7下下载
wget https://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpm

## Centos8下下载:
wget https://repo.mysql.com//mysql80-community-release-el8-1.noarch.rpm


## Centos6下安装Yum Repository
rpm -ivh mysql80-community-release-el6-3.noarch.rpm

## 备注:安装完毕之后在/etc/yum.repos.d/目录下多了mysql-community.repo和mysql-community-source.repo 这两个文件。

使用Yum Repository来安装MySQL8.0

## 方法1修改配置项
修改/etc/yum.repos.d/mysql-community.repo文件,其中enabled=1表示要安装的版本(本次安装8.0版本),其它版本均为0.
# Enable to use MySQL 5.6
[mysql56-community]
name=MySQL 5.6 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

# Enable to use MySQL 5.7
[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql80-community]
name=MySQL 8.0 Community Server
baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

## 方法2修改配置项
yum-config-manager --disable mysql57 -community
yum-config-manager --enable mysql80 -community

## 安装最新GA 8.0版的MySQL
yum install mysql-community-server

posted @ 2019-11-15 09:01  zhuntidaoren  阅读(460)  评论(0)    收藏  举报