一、下载
下载地址: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
相关文章
标签:服务器技术
- •VMware Workstation Pro 16安装CentOS7超详细图文步骤
- •CentOS7下配置使用JumpServer 堡垒机 (图文教程)
- •CentOS安装jdk的几种方法及配置环境变量方式
- •CentOS忘记密码修改方案以及centos卡在开机登录界面,命令失效的解决方法
- •解决笔记本安装centos7后无法调节屏幕亮度
- •VMware安装CentOS 8.1(CentOS 8系列可参考)的图文详细教程
- •CentOS7 minimal 最小化安装网络设置过程
- •CentOS7下搭建JumpServer
- •CentOS安装rpm包出现冲突时的解决办法
- •Vmware下CentOS7最小化安装方式