centos7.9安装MySQL8.0

这篇博客详细介绍了如何在CentOS7.9上卸载MariaDB并安装MySQL8.0。首先,检查MySQL是否已卸载;接着,下载MySQL的YUM仓库并安装;然后,成功安装数据库并启动服务;博主还分享了查看默认密码、修改初始密码以及启用远程访问的方法,并提供了MySQL参数优化的步骤。最后,重启数据库确保改动生效。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

#########查看系统版本###########
[root@ ~]# cat  /etc/redhat-release 
CentOS Linux release 7.9.2009 (Core)
  • centOS7中默认安装了MariaDB,需要先进行卸载

rpm -qa | grep -i mariadb
rpm -e --nodeps mariadb-libs-5.5.64-1.el7.x86_64

查询下本机mysql是否卸载干净

rpm -qa | grep mysql
  •  下载MySQL仓库并安装

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


等待完成
yum -y install mysql80-community-release-el7-3.noarch.rpm
  •  安装MySQL数据库

yum -y install mysql-community-server



如果报错(坑!!!!!!!!)


The GPG keys listed for the "MySQL 8.0 Community Server" repository are already installed but they are not correct for this package.
Check that the correct key URLs are configured for this repository.


 Failing package is: mys
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值