feat: 全自动安装 安装数据库部分

This commit is contained in:
Akatsukiro 2024-02-19 18:25:04 +08:00
parent d1b407a67e
commit dc460555db
Signed by: Akatsukiro
GPG Key ID: 93F1D32999999999

View File

@ -199,6 +199,7 @@ install_maraidb() {
dnf install ${MARIADB_PACKAGE_URL}/yum/10.6/centos/${os_version}/x86_64/mariadb-release-10.6-1.el8.noarch.rpm -y dnf install ${MARIADB_PACKAGE_URL}/yum/10.6/centos/${os_version}/x86_64/mariadb-release-10.6-1.el8.noarch.rpm -y
dnf install MariaDB-server MariaDB-client -y dnf install MariaDB-server MariaDB-client -y
fi fi
if [[ $autoFlag == "0" ]]; then
read -e -r -p "是否快速配置MariaDB? [Y/n] 默认 Y(es)" input read -e -r -p "是否快速配置MariaDB? [Y/n] 默认 Y(es)" input
case $input in case $input in
[yY][eE][sS] | [yY]) [yY][eE][sS] | [yY])
@ -214,6 +215,19 @@ install_maraidb() {
mysql_secure_installation mysql_secure_installation
;; ;;
esac esac
else
PWD = "$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
mysql_secure_installation <<EOF
y
$PWD
$PWD
y
y
y
y
EOF
fi
} }
install_php install_php