[mall@mall ~]$ rpm -qa | grep mysql
[mall@mall ~]$ rpm -qa | grep mariadb
[mall@mall ~]$ rpm -qa | grep -i -E mysql\|mariadb | xargs -n1 sudo rpm -e --nodeps
01_mysql-community-common-5.7.16-1.el7.x86_64.rpm
02_mysql-community-libs-5.7.16-1.el7.x86_64.rpm
03_mysql-community-libs-compat-5.7.16-1.el7.x86_64.rpm
04_mysql-community-client-5.7.16-1.el7.x86_64.rpm
05_mysql-community-server-5.7.16-1.el7.x86_64.rpm
mysql-connector-java-5.1.27-bin.jar
[mall@mall mysql]$ sudo rpm -ivh 01_mysql-community-common-5.7.16-1.el7.x86_64.rpm
[mall@mall mysql]$ sudo rpm -ivh 02_mysql-community-libs-5.7.16-1.el7.x86_64.rpm
[mall@mall mysql]$ sudo rpm -ivh 03_mysql-community-libs-compat-5.7.16-1.el7.x86_64.rpm
[mall@mall mysql]$ sudo rpm -ivh 04_mysql-community-client-5.7.16-1.el7.x86_64.rpm
[mall@mall mysql]$ sudo rpm -ivh 05_mysql-community-server-5.7.16-1.el7.x86_64.rpm
可能会报缺少依赖的错误!执行下面命令即可: [mall@mall mysql]$ sudo yum install libaio
[mall@mall mysql]$ sudo systemctl start mysqld
[mall@mall mysql]$ sudo cat /var/log/mysqld.log | grep password
mysql -uroot -p 'password'
mysql> set password=password("Qs23=zs32");
mysql> set global validate_password_length=4;
mysql> set global validate_password_policy=0;
mysql> set password=password("123456");
mysql> use mysql
mysql> select user, host from user;
mysql> update user set host="%" where user="root";
mysql> flush privileges;
mysql> quit;