Source: https://typecodes.com/linux/yuminstallmysql5710.html
Wget-i http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpmyum-y Install Mysql57-community-release-el7-7.noarch.rpmyum-y Install mysql-community-serversystemctl start mysqld.service
After installing and starting the MySQL service with Yum, the MySQL process automatically prints the root user's initial password in the process log:
[Email protected] ~]# mysql-uroot-penter password: ###### #输入默认的root密码后回车Welcome to the MySQL monitor. Commands End With; or \g.your MySQL connection ID is 2Server version:5.7.10copyright (c), the Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names trademarks of their respectiveowners. Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.mysql> ALTER USER ' root ' @ ' localhost ' identified by ' new password '; Query OK, 0 rows Affected (0.00 sec) Mysql> Exitbye
CentOS installs MySQL with Yum