下载地址:
https://downloads.mysql.com/archives/community/
CSDN下载地址
https://download.csdn.net/download/feng8403000/85003429
xftp上传包
解压包
tar -xvf mysql-5.7.22-1.el7.x86_64.rpm-bundle.tar
批量安装:
rpm -ivh mysql-community-common-5.7.22-1.el7.x86_64.rpm rpm -ivh mysql-community-libs-5.7.22-1.el7.x86_64.rpm --nodeps --force rpm -ivh mysql-community-libs-compat-5.7.22-1.el7.x86_64.rpm --nodeps --force rpm -ivh mysql-community-client-5.7.22-1.el7.x86_64.rpm --nodeps --force rpm -ivh mysql-community-server-5.7.22-1.el7.x86_64.rpm --nodeps --force
有快的有慢的,等一下就好了。
启动mysql,并查看运行状态,显示初始密码
systemctl start mysqld systemctl status mysqld grep password /var/log/mysqld.log
登录MySQL
mysql -u root -p
输入查询到的初始密码:
修改密码与刷新:
set global validate_password_policy=0; set password = password('大小写字母加数字至少8个长度'); flush privileges;
exit退出后重新登录,你发现可以用你修改的密码登录了。
外网链接
use mysql; update user set host="%" where user="root"; flush privileges;