Centos7 安装Mysql8

参考知乎如下链接
在 CentOS 7 上安装 MySQL 8.0

根据自己的安装实践,最好先设置镜像,即文中提到的清华镜像.
Mysql Community Edition 镜像使用帮助

内文如下:
Debian/Ubuntu 用户
再选择你的 Debian/Ubuntu 版本,文本框中内容写进 /etc/apt/sources.list.d/mysql-community.list
RHEL/CentOS 用户
新建 /etc/yum.repos.d/mysql-community.repo,内容如下:
Centos7

[mysql-connectors-community]
name=MySQL Connectors Community
baseurl=https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql-connectors-community-el7-$basearch/
enabled=1
gpgcheck=1
gpgkey=https://repo.mysql.com/RPM-GPG-KEY-mysql

[mysql-tools-community]
name=MySQL Tools Community
baseurl=https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql-tools-community-el7-$basearch/
enabled=1
gpgcheck=1
gpgkey=https://repo.mysql.com/RPM-GPG-KEY-mysql

[mysql-5.6-community]
name=MySQL 5.6 Community Server
baseurl=https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql-5.6-community-el7-$basearch/
enabled=0
gpgcheck=1
gpgkey=https://repo.mysql.com/RPM-GPG-KEY-mysql

[mysql-5.7-community]
name=MySQL 5.7 Community Server
baseurl=https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql-5.7-community-el7-$basearch/
enabled=1
gpgcheck=1
gpgkey=https://repo.mysql.com/RPM-GPG-KEY-mysql

[mysql-8.0-community]
name=MySQL 8.0 Community Server
baseurl=https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql-8.0-community-el7-$basearch/
enabled=1
gpgcheck=1
gpgkey=https://repo.mysql.com/RPM-GPG-KEY-mysql

注意如下:

yum install mysql80-community-release-el7-3.noarch.rpm
上面粗体部分要根据下载的rpm文件,进行相应的修改。
还有如果出现

The GPG keys listed for the “MySQL 8.0 Community Server“…but they are not correct for this package
错误,请运行:(参考了:https://blog.csdn.net/fangbaobao_luhw/article/details/124695082)

rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022

以上记录仅供查询.

马拉孙 2021-11-11 于北京泛五地区

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值