Browse Source

Minor fix

old-stable
Mitesh Shah 11 years ago
parent
commit
f5ab59ea2e
  1. 17
      src/lib/ee_lib_install_mysql.sh
  2. 7
      src/lib/ee_lib_setup_mysql.sh
  3. 4
      src/lib/ee_lib_variables.sh

17
src/lib/ee_lib_install_mysql.sh

@ -1,10 +1,12 @@
# Install mysql package
# Install MySQL Package
ee_lib_install_mysql()
{
# Mysql password only set if mysql is not installed
# if mysql is installed don't set wrong password in ~/.my.cnf
# Check mysql-server is installed or not
ee_lib_package_check mysql-server
# If mysql-server is not installed
# Then set random mysql password for root user
if [ -n $PACKAGE_NAME ]; then
# setting up mysql password
@ -13,10 +15,11 @@ ee_lib_install_mysql()
debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $ee_mysql_auto_pass"
# Generate ~/.my.cnf
echo -e "[client]\nuser=root\npassword=$ee_mysql_auto_pass" > ~/.my.cnf
echo -e "[client]\nuser=root\npassword=$ee_mysql_auto_pass" > ~/.my.cnf4
fi
ee_lib_echo "Installing MySQL, Please Wait..."
ee_lib_echo "Installing MySQL, please Wait..."
$EE_APT_GET install mysql-server mysqltuner percona-toolkit \
|| ee_lib_error "Unable To Install MySQL"
}
|| ee_lib_error "Unable to install MySQL, exit status = " $?
}

7
src/lib/ee_lib_setup_mysql.sh

@ -1,10 +1,9 @@
# Setup mysql
# Setup MySQL
ee_lib_setup_mysql()
{
# personal settings for mysql
ee_lib_echo "Updating MySQL Configuration Files, Please Wait..."
ee_lib_echo "Setting up MySQL, please wait..."
# Decrease mysql wait timeout
sed -i "/#max_connections/a wait_timeout = 30 \ninteractive_timeout = 60" /etc/mysql/my.cnf
}
}

4
src/lib/ee_lib_variables.sh

@ -13,13 +13,11 @@ readonly EE_APT_GET=$($EE_CONFIG_GET system.apt-get-assume-yes | grep -i true &>
if [ "$EE_LINUX_DISTRO" == "Ubuntu" ]; then
#Specify nginx package
readonly EE_NGINX_PACKAGE=nginx-custom
elif [ "$EE_LINUX_DISTRO" == "Debian" ]; then
# Specify nginx package
readonly EE_NGINX_PACKAGE=nginx-full
# Detect Debian version
readonly EE_DEBIAN_VERSION=$(lsb_release -r | awk '{print($2)}' | cut -d'.' -f1)
fi
# Find php user-name
@ -38,4 +36,4 @@ if [ -f ~/.my.cnf ];then
elif [ -f /root/.my.cnf ];then
readonly EE_MYSQL_USER=$(cat /root/.my.cnf | grep user | cut -d'=' -f2)
readonly EE_MYSQL_PASS=$(cat /root/.my.cnf | grep pass | cut -d'=' -f2 | sed -e 's/^"//' -e 's/"$//')
fi
fi

Loading…
Cancel
Save