最好在 su 下运行
-
安装wget
yum -y install wget

-
设置mysql 官方仓库
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm

-
开始安装MySql
yum install mysql-server
这个要执行较长时间

如果遇到报错
Failing package is: mysql-community-common-5.7.42-1.el7.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
执行rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 再安装
参考:https://blog.youkuaiyun.com/best_dayc_cm/article/details/130804959
至此安装完成
修改密码
AlTER USER 'root'@'localhost' IDENTIFIED BY '123456';
本文档介绍了如何在 CentOS7 系统下安装 MySQL 5.7,包括通过 yum 安装 wget,添加 MySQL 官方仓库,安装 MySQL 服务器,解决安装过程中可能出现的问题,如 GPG 错误,以及启动和设置 MySQL 服务,并为 root 用户设置新密码。

4012

被折叠的 条评论
为什么被折叠?



