环境:
redhat6.5
MySQL Community Server 5.7.28 https://dev.mysql.com/downloads/mysql/5.7.html
安装RMP包的具体操作如下:
1、如有mariadb,先卸载
rpm -qa |grep mariadb
rpm -qa |grep mysql*
rpm -e --nodeps xxxxxx (卸载查询到的rpm包)
2、安装新的mysql5.7.28,解压安装包
tar -xvf mysql-5.7.28-1.el6.x86_64.rpm-bundle.tar
3、rpm安装(不是所有包必须安装,但必须按顺序安装)
rpm -ivh mysql-community-common-5.7.28-1.el6.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.28-1.el6.x86_64.rpm
rpm -ivh mysql-community-libs-compat-5.7.28-1.el6.x86_64.rpm
rpm -ivh mysql-community-client-5.7.28-1.el6.x86_64.rpm
rpm -ivh mysql-community-server-5.7.28-1.el6.x86_64.rpm
rpm -ivh mysql-community-devel-5.7.28-1.el6.x86_64.rpm
4、安装完毕,数据库初始化
mysqld --initialize --user=mysql
5、查看临时生成的数据库密码
cat /var/log/mysqld.log
6、启动mysql
service mysqld start
7、登陆mysql数据库,并修改密码
mysql -uroot -p
set password = password(‘password‘);
至此安装完毕!
原文地址:https://www.cnblogs.com/zakker/p/11765570.html