A: Go to the official website to view the latest installation package
https://dev.mysql.com/downloads/repo/yum/
Two: Download MySQL source installation package
mysql80-community-release-el7-1.noarch.rpm
Install MySQL source
Yum-y Install mysql80-community-release-el7-1.noarch.rpm
Yum Repolist All | grep MySQL
Three: Install MySQL server
Yum Install Mysql-community-server
The middle will pop up is the choice of whether or not, select Y can, and then patiently wait for it ....
Four: Start the MySQL service
Systemctl Start Mysqld.service
Run the command to see the running state
Systemctl Status Mysqld.service
Five: Initialize the database password
Check the initial password
grep "Password"/var/log/mysqld.log
Login
Mysql-uroot-p
Change Password
ALTER USER ' root ' @ ' localhost ' identified by ' **************** ';
MySQL Default password security check-in (Validate_password) is installed, and the default password checking policy requires that the password must contain: uppercase and lowercase letters, numbers, and special symbols, and cannot be less than 8 bits in length. Otherwise it will prompt error 1819 (HY000): Your password does not satisfy the current policy requirements error
VI: Database Authorization
Database is not authorized, only localhost local access is supported
Mysql>grant all privileges on * * to ' root ' @ '% ' identified by ' 123456 ' with GRANT OPTION;
You need to enter a user name and password when connecting to the database remotely
User name: Root
Password: 123456
Mysql>flush privileges;
You can also implement a remote by modifying the table:
Mysql-u root-p
mysql> use MySQL;
mysql> Update user Set host = '% ' where user = ' root ';
Seven: Set auto-start
Systemctl Enable Mysqld
Systemctl Daemon-reload
CentOS 7 Yum Install MySQL