- ?官方下载地址:
wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.17-1.el6.x86_64.rpm-bundle.tar
- 解压:
tar xvf mysql-5.7.17-1.el6.x86_64.rpm-bundle.tar
- 卸载之前的版本
rpm -qa | grep -i mysql
rpm -e --nodeps 要卸载的mysql版本
- 按照步骤来安装就好
1.rpm -ivh mysql-community-libs-5.7.17-1.el6.x86_64.rpm --nosignature
2.rpm -ivh mysql-community-devel-5.7.17-1.el6.x86_64.rpm --nosignature
3.rpm -ivh mysql-community-client-5.7.17-1.el6.x86_64.rpm --nosignature
4.rpm -ivh mysql-community-server-5.7.17-1.el6.x86_64.rpm --nosignature
- 修改密码 (有点特殊 )
1.找到my.cnf | 本机 /etc/my.cnf
2.[mysqld]#下添加
skip-grant-tables=1 #不用验证
3.开启mysql /etc/init.d/mysqld start|本机默认地址
4.进入并修改(依次命令)
? 1. mysql -uroot -p;
? 2.use mysql
? 3.update user set authentication_string = password(‘123456‘), password_expired = ‘N‘, password_last_changed = now() where user = ‘root‘;
? ?5.my.cnf | 本机 /etc/my.cnf 里面删除skip-grant-tables=1
?6.测试
? mysql -uroot -p123456 -e "show databases;";
?7.OK收工;
遇到的错误总结:
1.默认提示需要输入校验码
[[email protected] tool]# rpm -ivh mysql-community-devel-5.7.17-1.el6.x86_64.rpm
warning: mysql-community-devel-5.7.17-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
解决:(去掉校验安装)
rpm -ivh mysql-community-devel-5.7.17-1.el6.x86_64.rpm --nosignature
2.木有安装 mysql-community-libs-5.7.17-1.el6.x86_64.rpm
[[email protected] tool]# rpm -ivh mysql-community-devel-5.7.17-1.el6.x86_64.rpm --nosignature
error: Failed dependencies:
libmysqlclient.so.20()(64bit) is needed by mysql-community-devel-5.7.17-1.el6.x86_64
mysql-community-libs(x86-64) >= 5.7.9 is needed by mysql-community-devel-5.7.17-1.el6.x86_64
解决:
rpm -ivh mysql-community-libs-5.7.17-1.el6.x86_64.rpm --nosignature