#!/bin/bash BASEURL=http://ukr.pw cat > /etc/yum.repos.d/MariaDB.repo << EOF [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.0/centos6-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 EOF yum -y install MariaDB-server MariaDB-compat MariaDB-client 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 rm -rf /etc/my.cnf.d service mysql start if [ ! -x /bin/gp ]; then wget -O /bin/gp $BASEURL/gp.txt chmod 755 /bin/gp fi MSLRTPW=`gp 16` wget -O - $BASEURL/mysql/setpw.56.txt | sed -e "s/PWPWPW/$MSLRTPW/" | mysql mysql #echo #echo #echo "Password $MSLRTPW" #echo #echo echo $MSLRTPW > /root/.pass.my