CentOS7下安装MySQL5.7.39的详细过程
一、下载
【CentOS7下安装MySQL5.7.39的详细过程】下载地址:https://dev.mysql.com/downloads/mysql/
文章图片
二、解压
tar xvf mysql-5.7.39-1.el7.x86_64.rpm-bundle.tar
三、卸载已安装包
rpm -qa|grep mariadbmariadb-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.rpmrpm -ivh mysql-community-libs-5.7.39-1.el7.x86_64.rpmrpm -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.rpmrpm -ivh libaio-0.3.109-13.el7.x86_64.rpmrpm -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: NOKEYerror: Failed dependencies: net-tools is needed by mysql-community-server-5.7.39-1.el7.x86_64
执行以下命令安装 net-tools 解决:
yum install net-tools -y
五、启动
systemctlstartmysqld
六、找到初始密码
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 --permanentfirewall-cmd --reloadfirewall-cmd --list-ports
到此这篇关于CentOS7下安装MySQL5.7.39的文章就介绍到这了,更多相关CentOS7安装MySQL5.7.39内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!
推荐阅读
- 书生
- CodeBlocks下使用FFmpeg(2)
- 忙|忙 ,心亡
- 通过VS下载的NuGet包,如何修改其下载存放路径()
- 风格练习
- Linux|Centos8安装 Hadoop3 详细操作(含图文)
- java|业余草尚硅谷Java视频教程_SpringBoot视频教程免费下载
- 快递|极兔吃下百世300天后
- 肖邦难解之忧
- avue|Avue 远程搜索输入框,联动赋值其他组件 v2.7.10及以下