One view version
Cat/etc/redhat-release
Two-install Yum source
RPM-IVH https://repo.mysql.com//mysql57-community-release-el7-9.noarch.rpm
Note: 1 If the above connection is invalid, please open the following connection, replace the download connection according to the system version
2 default installation version 5.7, if you want to install version 5.6, modify/etc/yum.repos.d/mysql-community.repo
3 Change the enabled=1 of the 5.7 source to enabled=0. Then change the 5.6 source enabled=0 to Enabled=1.
Three-install MySQL
Yum Install Mysql-community-server
Four service start-up
Systemctl Start mysqld
Systemctl Enable Mysqld
Five modify the root local login password
Mysqladmin-u root-p oldpass Password "Newpass"
Note: 1 after the MySQL installation is complete, a default password is generated for root in the/var/log/mysqld.log file
2 grep ' temporary password '/var/log/mysqld.log find root default password
3 mysql5.7 The password security check plug-in (Validate_password) is installed by default, and the default password-checking policy requires that the password must contain: uppercase and lowercase letters, numbers, and special symbols, and not less than 8 bits in length. Otherwise it will prompt error 1819 (HY000): Your password does not satisfy the current policy requirements error
Centos7 Yum install MySQL