+function _install_mysql_package(){
+ echo '
+ #################################################################
+ ##### INSTALL REQUIRED PACKAGES #####
+ #################################################################'
+ [ "$_DISTRO" == "Ubuntu" ] && ! install_packages "mysql-server" && exit 1
+ [ "$_DISTRO" == "CentOS" -o "$_DISTRO" == "Red" ] && ! install_packages "mariadb mariadb-server" && exit 1
+
+ if [[ "$_DISTRO" == "Ubuntu" ]]
+ then
+ #start services. By default CentOS does not start services
+ service mysql start >> /dev/null
+ # try to set admin password, ignore if fails
+ [[ -n $DBPASSWD ]] && mysqladmin -u $DB_ADMIN_USER -s password $DB_ADMIN_PASSWD
+ fi
+
+ if [ "$_DISTRO" == "CentOS" -o "$_DISTRO" == "Red" ]
+ then
+ #start services. By default CentOS does not start services
+ service mariadb start
+ service httpd start
+ systemctl enable mariadb
+ systemctl enable httpd
+ read -e -p "Do you want to configure mariadb (recommended if not done before) (Y/n)" KK
+ [ "$KK" != "n" -a "$KK" != "no" ] && mysql_secure_installation
+
+ read -e -p "Do you want to set firewall to grant web access port 80,443 (Y/n)" KK
+ [ "$KK" != "n" -a "$KK" != "no" ] &&
+ firewall-cmd --permanent --zone=public --add-service=http &&
+ firewall-cmd --permanent --zone=public --add-service=https &&
+ firewall-cmd --reload
+ fi