wget http://repo.mysql.com/yum/mysql-5.7-community/el/6/x86_64/mysql57-community-release-el6-10.noarch.rpm;
rpm -Uvh mysql57-community-release-el6-10.noarch.rpm;
yum-config-manager --disable mysql80-community;
yum-config-manager --enable mysql57-community;
yum install mysql-community-server -y;
service mysqld start
Setting freshly installed root password requires a bit of dancing.
# Temp password generated on startup:
export DEFAULTPW=`cat /var/log/mysqld.log | grep "A temporary password is generated for" | awk '{print $NF}'`;
# Explicitly set a password which is accepted by the validate_password plugin by default:
mysql --password=$DEFAULTPW -e "SET PASSWORD = PASSWORD('r000000000000t');FLUSH PRIVILEGES;" --connect-expired-password;
# Disable the validate_password plugin:
mysql --password=r000000000000t -e "uninstall plugin validate_password;";
# Finally, we can set the password to be the same as it is everywhere else:
mysql --password=r000000000000t -e "SET PASSWORD = PASSWORD('root');FLUSH PRIVILEGES;";
mysql_upgrade -u root --password=root;
service mysqld restart;