步骤一:首先下载mysql的yum源配置

1 | wget http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm

步骤二:安装mysql的yum源

1 |yum -y install mysql57-community-release-el7-11.noarch.rpm

步骤三:yum方式安装mysql

1 | yum -y install mysql-server –nogpgcheck

步骤四:使用mysql

1 | systemctl start mysqld.service
2 | systemctl status mysql.service

cat /var/log/mysqld.log| grep password

步骤五: 进入命令行mysql

步骤六: 修改数据库密码

ALTER USER USER() IDENTIFIED BY ‘123456@Aa’;

alter user ‘root’@’%’ identified by ‘123456@Aa’ password expire never;

grant all privileges on *.* to ‘root’@’%’ identified by ‘123456A@a’ with grant option;

set global validate_password_policy=0;

set global validate_password_mixed_case_count=1;

set global validate_password_number_count=1;

set global validate_password_length=4;

flush privileges;