1.软件下载
https://www.mysql.com/downloads/
找到mysql community GPL download--mysql community server--选择5.7.44和rhel/oracle 下载mysql-5.7.44-1.el7.x86_64.rpm-bundle.tar 2.停服备份 systemctl stop mysqld cp /etc/my.cnf /etc/my.cnf.bak20240801 配置文件 tar -zcvf /backup/mysql.tar.gz /var/lib/mysql 数据目录 3.安装 cd /root/mysql_software tar xvf mysql-5.7.44-1.el7.x86_64.rpm-bundle.tar 需要删除mysql-community-test-5.7.44-1.el7.x86_64.rpm rpm -Uvh *.rpm 4.启动mysqld systemctl start mysqld systemctl status mysqld mysql -V 查看版本 5.重置root密码 修改/etc/my.cnf 加入一行skip-grant-tables 重启mysqld服务 mysql -uroot -p 回车 use mysql update user set authentication_string=PASSWORD('1Sw@Z280!') where User='root'; flush privileges; 修改完后去掉skip-grant-tables重启mysqld systemctl stop mysqld systemctl start mysqld 6.mysql执行upgrade升级 mysql_upgrade -uroot -p1Sw@Z280! 标签:5.7,mysql5.7,40,systemctl,mysqld,mysql,rpm,44 From: https://www.cnblogs.com/sherq1989/p/18426444