|
@@ -114,6 +114,13 @@ comprobarError() {
|
|
212)
|
|
212)
|
|
error="\n$type $codeNum:\tImposible recargar base de datos."
|
|
error="\n$type $codeNum:\tImposible recargar base de datos."
|
|
;;
|
|
;;
|
|
|
|
+ 213)
|
|
|
|
+ error="\n$type $codeNum:\tImposible configurar SQL.\n"
|
|
|
|
+ ;;
|
|
|
|
+ 214)
|
|
|
|
+ type="WARNING"
|
|
|
|
+ error="\n$type $codeNum:\tSQL ya está configurado."
|
|
|
|
+ ;;
|
|
300)
|
|
300)
|
|
error="\n$type $codeNum:\tError interno (instalación PHP-7.2).\n"
|
|
error="\n$type $codeNum:\tError interno (instalación PHP-7.2).\n"
|
|
;;
|
|
;;
|
|
@@ -946,6 +953,7 @@ instalarMySQL() {
|
|
else
|
|
else
|
|
comprobarError 1 203
|
|
comprobarError 1 203
|
|
fi
|
|
fi
|
|
|
|
+ deshabilitarServicio $sqlServerName
|
|
}
|
|
}
|
|
|
|
|
|
instalarMariaDB() {
|
|
instalarMariaDB() {
|
|
@@ -959,6 +967,42 @@ instalarMariaDB() {
|
|
else
|
|
else
|
|
comprobarError 1 204
|
|
comprobarError 1 204
|
|
fi
|
|
fi
|
|
|
|
+ deshabilitarServicio $sqlServerName
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+configurarSQL() {
|
|
|
|
+ # Configura MariaDB o MySQL
|
|
|
|
+ if [ $mariaDBOn = true ] && [ $debianOS = true ];then
|
|
|
|
+ sqlConfFile="/etc/mysql/my.cnf"
|
|
|
|
+ elif [ $mariaDBOn = true ] && [ $rhelOS = true ];then
|
|
|
|
+ sqlConfFile="/etc/my.cnf"
|
|
|
|
+ elif [ $mySQLOn = true ] && [ $debianOS = true ];then
|
|
|
|
+ sqlConfFile="/etc/mysql/my.cnf"
|
|
|
|
+ else
|
|
|
|
+ comprobarError 1 213
|
|
|
|
+ fi
|
|
|
|
+ if [ ! -f $sqlConfFile ];then
|
|
|
|
+ comprobarError 1 213
|
|
|
|
+ fi
|
|
|
|
+ grep "# Configuration for Moodle" $sqlConfFile >/dev/null 2>&1
|
|
|
|
+ if [ $? -ne 0];then
|
|
|
|
+ # Establecemos UTF8 (codificación de caracteres) y Barracuda (sistema de ficheros)
|
|
|
|
+ echo -en "\n# Configuration for Moodle\n" >> $sqlConfFile
|
|
|
|
+ echo -en "[client]\n" >> $sqlConfFile
|
|
|
|
+ echo -en "default-character-set = utf8mb4\n\n" >> $sqlConfFile
|
|
|
|
+ echo -en "[mysqld]\n" >> $sqlConfFile
|
|
|
|
+ echo -en "innodb_file_format = Barracuda\n" >> $sqlConfFile
|
|
|
|
+ echo -en "innodb_file_per_table = 1\n" >> $sqlConfFile
|
|
|
|
+ echo -en "innodb_large_prefix\n\n" >> $sqlConfFile
|
|
|
|
+ echo -en "character-set-server = utf8mb4\n" >> $sqlConfFile
|
|
|
|
+ echo -en "collation-server = utf8mb4_unicode_ci\n" >> $sqlConfFile
|
|
|
|
+ echo -en "skip-character-set-client-handshake\n\n" >> $sqlConfFile
|
|
|
|
+ echo -en "[mysql]\n" >> $sqlConfFile
|
|
|
|
+ echo -en "default-character-set = utf8mb4\n" >> $sqlConfFile
|
|
|
|
+ else
|
|
|
|
+ comprobarError 1 214
|
|
|
|
+ fi
|
|
|
|
+ unset sqlConfFile
|
|
}
|
|
}
|
|
|
|
|
|
instalarPHP() {
|
|
instalarPHP() {
|
|
@@ -1471,8 +1515,15 @@ mostrarExpress
|
|
fi
|
|
fi
|
|
# Configuración Database (Arrancar Base de Datos, establecer contraseña y configuración segura)
|
|
# Configuración Database (Arrancar Base de Datos, establecer contraseña y configuración segura)
|
|
if [ $mySQLOn = true ] || [ $mariaDBOn = true ];then
|
|
if [ $mySQLOn = true ] || [ $mariaDBOn = true ];then
|
|
|
|
+ echo -en "Configurando Base de Datos..." | tee -a $logFile
|
|
|
|
+# {
|
|
|
|
+# echo -en "%s\n" $((100 * progreso / progresoTotal))
|
|
|
|
+ configurarSQL
|
|
|
|
+ progreso=$((progreso + 1))
|
|
|
|
+# } > >(whiptail --gauge "Configurando Base de Datos MySQL..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal)))
|
|
|
|
+ echo -en " OK.\n" | tee -a $logFile
|
|
habilitarServicio "$sqlServerName"
|
|
habilitarServicio "$sqlServerName"
|
|
- echo -en "Configurando Base de Datos MySQL..." | tee -a $logFile
|
|
|
|
|
|
+ echo -en "Estableciendo contraseña de la Base de Datos..." | tee -a $logFile
|
|
# {
|
|
# {
|
|
# echo -en "%s\n" $((100 * progreso / progresoTotal))
|
|
# echo -en "%s\n" $((100 * progreso / progresoTotal))
|
|
establecerSQLPasswd
|
|
establecerSQLPasswd
|