Skip to content

Instantly share code, notes, and snippets.

@imlucas
Created June 6, 2018 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imlucas/9a3d99bf64545fa9181e006d5ad2792c to your computer and use it in GitHub Desktop.
Save imlucas/9a3d99bf64545fa9181e006d5ad2792c to your computer and use it in GitHub Desktop.

Installing MySQL for testing on rhel 6.2 via Evergreen

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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment