CentOS7 default database is MARIADB, configuration and so on is not accustomed to, so decided to change to MySQL, but CentOS7 yum source in the default seems to be no MySQL. To solve this problem, we first download the MySQL repo source.
1. Because there is no MySQL in the CentOS yum source, you need to download yum repo profile on MySQL's official website.
wget http://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
2. Install Yum repo file
RPM-IVH mysql57-community-release-el7-9.noarch.rpm
When the execution is complete, two repo files are generated in the/etc/yum.repos.d/directory Mysql-community.repo Mysql-community-source.repo
3. Then update the Yum cache
Yum Clean all
yum Makecache
4. Install MySQL
Yum Install mysql-community-client.x86_64 mysql-community-common.x86_64 mysql-community-devel.x86_64 Mysql-community-libs.x86_64 mysql-community-server.x86_64
Or
5. Start MySQL
6. View the initial password
grep ' temporary password '/var/log/mysqld.log
Get the following content:
2016-10-28t10:36:32.369073z 1 [note] A temporary password are generated for root@localhost:5oazqgpiat!p
7. Login with initial password
Mysql-u root-p//Enter, then enter the initial password found in the previous step
8. Change the initial password
ALTER USER ' root ' @ ' localhost ' identified by ' mynewpass4! ';
MySQL now requires a higher password strength, including uppercase and lowercase letters, numbers, and special characters
At this point, the Mysql-server installation is complete