Download the response version of the YUM source on the MySQL official network: http://dev.mysql.com/downloads/repo/yum/
# download Source $wgethttp//dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm# Installation Source $ rpm-IVH mysql57-community-release-el7-9. noarch.rpm# installed MySQL, will auto-install dependent software $Yum Install-Y mysql-server# Modifying MySQL configuration file $VI/etc/my.cnf# Modifying or shutting down the MySQL password policy (optional line): Validate_password_policy=0Validate_password=off# Modify the default encoding for UTF-8, added after [mysqld] Character_set_server=Utf8init_connect='SET NAMES UTF8'# activate MySQL service; Systemctl is used instead of service and Chkconfig, with Baidu $ systemctl start mysqld# startup MySQL service $ systemctl Enable Mys qld# re-download service $ systemctl Daemon-reload# View the root user password for MySQL and/var/log/generate a password for root in Mysqld.log $grep 'Temporary password'/var/log/mysqld.log# using root login mysql$ MySQL-uroot-p# to modify MySQL root password mysql> Alter User'Root'@'localhost'Identified by'Xinmi Password'; # Add remote Chengdeng user, with Baidu MySQL> Grant rights privileges on the repository. Table or other to'User name'@'%'Identified by'Password'With Grant option;# exit Mysqlmysql> quit;
Address: http://blog.csdn.net/xyang81/article/details/51759200
"Linux CentOS" CentOS 7 YUM Install MySQL 5.7