#!/bin/bash BASEURL=http://ukr.pw yum -y install http://www.percona.com/downloads/percona-release/redhat/0.1-4/percona-release-0.1-4.noarch.rpm yum -y install Percona-Server-client-57 Percona-Server-server-57 Percona-Server-shared-57 Percona-Server-shared-compat-57 rm -rf /etc/my.cnf /etc/my.cnf.d wget -O - $BASEURL/mysql/my.cnf.5.6.txt > /etc/my.cnf QUARTERRAM=`free | grep Mem: | awk '{ print int($2/4096)"M" }'` sed -i -e "s/pool_size=64M/pool_size=${QUARTERRAM}/" /etc/my.cnf systemctl start mysqld.service systemctl stop mysqld.service echo "validate_password_mixed_case_count=1" >> /etc/my.cnf echo "validate_password_number_count=0" >> /etc/my.cnf echo "validate_password_policy=LOW" >> /etc/my.cnf echo "validate_password_special_char_count=0" >> /etc/my.cnf systemctl start mysqld.service if [ ! -x /bin/gp ]; then wget -O /bin/gp $BASEURL/gp.txt chmod 755 /bin/gp fi MSLRTPW=`gp 16` journalctl | grep "temporary password" | awk '{ print $16 }' > /dev/shm/.tmp.pass wget -O - $BASEURL/mysql/setpw.57.txt | sed -e "s/PWPWPW/$MSLRTPW/" | mysql --connect-expired-password -u root -p`cat /dev/shm/.tmp.pass` mysql rm -f /dev/shm/.tmp.pass echo echo echo "MySQL root password is $MSLRTPW" echo echo echo $MSLRTPW > /root/.pass.my