centos7 内网安装mysql5.7

配合内网的需求,需要离开互联网安装mysql5.7.以下为实操步骤。

一、准备mysql5.7和libaio的rpm包

https://download.csdn.net/download/in_christ/12614368 笔者自用的包可供下载,0积分。

二、解压并安装

tar -xf mysql-5.7.30-1.el7.x86_64.rpm-bundle.tar #解压压缩包
rpm -e --nodeps mariadb-libs-5.5.65-1.el7.x86_64
rpm -ivh mysql-community-common-5.7.30-1.el7.x86_64.rpm 
rpm -ivh mysql-community-libs-5.7.30-1.el7.x86_64.rpm 
rpm -ivh mysql-community-client-5.7.30-1.el7.x86_64.rpm 
rpm -ivh mysql-community-server-5.7.30-1.el7.x86_64.rpm 
rpm -ivh mysql-community-devel-5.7.30-1.el7.x86_64.rpm 
rpm -ivh mysql-community-server-5.7.30-1.el7.x86_64.rpm --nodeps --force #安装server不加--nodeps --force,则会提示缺少net-tool、perl等依赖。这里做忽略操作

三、运行并更改密码

systemctl start mysqld  #启动mysql
server mysqld status  #查看mysql运行状态
grep 'temporary password' /var/log/mysqld.log
MYSQL> SET PASSWORD FOR 'root'@'localhost'= "123456"; #用以上查到的密码登录mysql,登录步骤忽略。该条为修改语句。
MYSQL> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;#开启远程登录

 

你可能感兴趣的:(centos)