mysql5.7安装
1. wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm 2.如果提示wget命令不存在,先执行 yum -y install wget 3.安装yum yum -y localinstall mysql57-community-release-el7-11.noarch.rpm yum -y install mysql-community-server 4.启动 systemctl start mysqld 5.修改密码 vim /var/log/mysqld.log 如果mysqld.log下面没有密码,在/etc/my.cnf配置文件中添加 skip-grant-tables 6.登录终端 修改密码 mysql5.7默认密码策略要求密码必须是大小写字母数字特殊字母的组合,至少8位 mysql -u root -p 如果在/etc/my.cnf配置文件中添加 skip-grant-tables, 就直接回车 use mysql; update user set authentication_string=password('密码') where user='root' and host='localhost'; ALTER USER 'root'@'localhost'