1.mkdir mysqlinstall #新建mysql的文件夹
2.tar -xvf mysql-5.7.26-1.el6.x86_64.rpm-bundle #解压mysql的安装包得到以下的安装文件
3.rpm -qa|grep postfix #卸载冲突的组件
4.yum install libaio #安装需要安装对应的组件
5.以此安装以下四个包:
- mysql-community-common-5.7.26-1.el6.x86_64.rpm
- mysql-community-libs-5.7.26-1.el6.x86_64.rpm
- mysql-community-client-5.7.26-1.el6.x86_64.rpm
- mysql-community-server-5.7.26-1.el6.x86_64.rpm
注:在安装过程中会碰到版本不匹配的错误(mysql-community-common-5.7.26.el6.x86_64 conflicts with file from packages mysql-community-libs-5.1.13-1.el6.x86_64)
解决方法:可执行rpm -e --nodeps mysql-community-libs-5.1.13-1.el6.x86_64
- 安装 rpm -ivh mysql-community-server-5.7.26-1.el6.x86_64.rpm等包名;
6.service mysqld restart #重启mysql
7.grep password /var/log/mysqld.log #查看临时密码
8.mysql -u root -p #登录用户
9.set password = password('Mysql_1234'); #重置登录密码
10.service mysqld restart;#重启mysql
转载于:https://www.cnblogs.com/changfan/p/11251640.html