登录
首页 >  数据库 >  MySQL

CentOS7下安装MySQL5.7.39的详细过程

来源:脚本之家

时间:2022-12-29 16:12:44 464浏览 收藏

亲爱的编程学习爱好者,如果你点开了这篇文章,说明你对《CentOS7下安装MySQL5.7.39的详细过程》很感兴趣。本篇文章就来给大家详细解析一下,主要介绍一下MySQL、CentOS7安装、5.7.39,希望所有认真读完的童鞋们,都有实质性的提高。

一、下载

下载地址:https://dev.mysql.com/downloads/mysql/

二、解压

tar xvf mysql-5.7.39-1.el7.x86_64.rpm-bundle.tar

三、卸载已安装包

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

四、按顺序安装rpm包

rpm -ivh mysql-community-common-5.7.39-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.39-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.39-1.el7.x86_64.rpm
// 如果安装 mysql-community-server-5.7.39-1.el7 报 libaio.so.1 依赖错误,需先安装 libaio-0.3.109-13.el7.x86_64.rpm
rpm -ivh libaio-0.3.109-13.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.7.39-1.el7.x86_64.rpm

安装 server 还可能报错:

rpm -ivh mysql-community-server-5.7.39-1.el7.x86_64.rpm 
warning: mysql-community-server-5.7.39-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
error: Failed dependencies:
	net-tools is needed by mysql-community-server-5.7.39-1.el7.x86_64

执行以下命令安装 net-tools 解决:

yum install net-tools -y

五、启动

systemctl  start  mysqld

六、找到初始密码

cat /var/log/mysqld.log | grep 'password is generated'

七、修改密码并授权

alter user 'root'@'localhost' identified by 'xxxxxx';
grant all privileges on *.*  to  'root'@'%'  identified by 'xxxxxx'  with grant option;
flush privileges;

八、开启防火墙,允许外网访问

firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --reload
firewall-cmd --list-ports

好了,本文到此结束,带大家了解了《CentOS7下安装MySQL5.7.39的详细过程》,希望本文对你有所帮助!关注golang学习网公众号,给大家分享更多数据库知识!

声明:本文转载于:脚本之家 如有侵犯,请联系study_golang@163.com删除
相关阅读
更多>
最新阅读
更多>
课程推荐
更多>
评论列表