yum本地安装mysql5.7

yum本地安装mysql5.7

step1 下载所需的rpm包

mysql-community-server-5.7.27-1.el7.x86_64.rpm
mysql-community-client-5.7.27-1.el7.x86_64.rpm
mysql-community-libs-5.7.27-1.el7.x86_64.rpm
mysql-community-common-5.7.27-1.el7.x86_64.rpm

step2 卸载MariaDB

yum remove mariadb-libs

step 3 yum安装rpm包

yum install -y *.rpm

step4 启动mysql服务

systemctl start mysqld

step5 修改默认的登录密码

查看默认的登录密码:

grep 'temporary password' /var/log/mysqld.log

利用默认的登录密码登录MySQL,然后修改密码:

alter user 'root'@'localhost' identified by 'newpassword';
flush privileges;

你可能感兴趣的:(MySQL数据库安装配置)