From 33343e1b1c051a03dd737d6cb0b9c275d751fb7e Mon Sep 17 00:00:00 2001 From: dami Date: Sat, 22 Nov 2025 18:15:34 +0800 Subject: [PATCH 01/12] Update index.py --- plugins/mysql/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index 45247d12dc..ba0f330db5 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -446,7 +446,7 @@ def getShowLogFile(): def getMdb8Ver(): - return ['8.0','8.1','8.2','8.3','8.4','9.0',"9.1","9.2"] + return ['8.0','8.1','8.2','8.3','8.4','9.0',"9.1","9.2","9.3","9.4"] def getSlaveName(): From 832d8f44f191b80d1711ea2bdbd5d80dda28a95e Mon Sep 17 00:00:00 2001 From: dami Date: Sat, 22 Nov 2025 18:20:24 +0800 Subject: [PATCH 02/12] update --- plugins/mysql/versions/9.3/install.sh | 4 +- plugins/mysql/versions/9.4/install.sh | 230 ++++++++++++++++++++++++++ 2 files changed, 232 insertions(+), 2 deletions(-) create mode 100755 plugins/mysql/versions/9.4/install.sh diff --git a/plugins/mysql/versions/9.3/install.sh b/plugins/mysql/versions/9.3/install.sh index abc5733ca1..cbd100f1ea 100755 --- a/plugins/mysql/versions/9.3/install.sh +++ b/plugins/mysql/versions/9.3/install.sh @@ -108,7 +108,7 @@ Install_mysql() if [ -f ${mysqlDir}/mysql-${VERSION}.tar.gz ];then md5_mysql=`md5sum ${mysqlDir}/mysql-${VERSION}.tar.gz | awk '{print $1}'` if [ "${md5_mysql_ok}" == "${md5_mysql}" ]; then - echo "mysql9.2 file check ok" + echo "mysql9.3 file check ok" else # 重新下载 rm -rf ${mysqlDir}/mysql-${VERSION} @@ -206,7 +206,7 @@ Install_mysql() if [ -d $serverPath/mysql ];then rm -rf ${mysqlDir}/mysql-${VERSION} - echo '9.2' > $serverPath/mysql/version.pl + echo '9.3' > $serverPath/mysql/version.pl echo "${VERSION}安装完成" else # rm -rf ${mysqlDir}/mysql-${VERSION} diff --git a/plugins/mysql/versions/9.4/install.sh b/plugins/mysql/versions/9.4/install.sh new file mode 100755 index 0000000000..f0aaffcaf0 --- /dev/null +++ b/plugins/mysql/versions/9.4/install.sh @@ -0,0 +1,230 @@ +# -*- coding: utf-8 -*- +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin +export PATH + +# https://dev.mysql.com/downloads/mysql/ + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sysName=`uname` + + +mysqlDir=${serverPath}/source/mysql + +_os=`uname` +echo "use system: ${_os}" +if [ ${_os} == "Darwin" ]; then + OSNAME='macos' +elif grep -Eq "openSUSE" /etc/*-release; then + OSNAME='opensuse' + zypper refresh +elif grep -Eq "FreeBSD" /etc/*-release; then + OSNAME='freebsd' + pkg install -y wget unzip +elif grep -Eqi "Arch" /etc/issue || grep -Eq "Arch" /etc/*-release; then + OSNAME='arch' + echo y | pacman -Sy unzip +elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then + OSNAME='centos' + yum install -y wget zip unzip +elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then + OSNAME='fedora' + yum install -y wget zip unzip +elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then + OSNAME='rocky' + yum install -y wget zip unzip +elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then + OSNAME='alma' + yum install -y wget zip unzip +elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then + OSNAME='debian' + apt update -y + apt install -y devscripts + apt install -y wget zip unzip +elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then + OSNAME='ubuntu' + apt install -y wget zip unzip +else + OSNAME='unknow' +fi + +VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` + + +VERSION=9.4.0 +# https://dev.mysql.com/get/Downloads/MySQL-9.2/mysql-${VERSION}.tar.gz +# https://cdn.mysql.com//Downloads/MySQL-9.2/mysql-boost-${VERSION}.tar.gz +Install_mysql() +{ + mkdir -p ${mysqlDir} + echo '正在安装脚本文件...' + + + # ----- cpu start ------ + if [ -z "${cpuCore}" ]; then + cpuCore="1" + fi + + if [ -f /proc/cpuinfo ];then + cpuCore=`cat /proc/cpuinfo | grep "processor" | wc -l` + fi + + MEM_INFO=$(free -m|grep Mem|awk '{printf("%.f",($2)/1024)}') + if [ "${cpuCore}" != "1" ] && [ "${MEM_INFO}" != "0" ];then + if [ "${cpuCore}" -gt "${MEM_INFO}" ];then + cpuCore="${MEM_INFO}" + fi + else + cpuCore="1" + fi + + if [ "$cpuCore" -gt "2" ];then + cpuCore=`echo "$cpuCore" | awk '{printf("%.f",($1)*0.8)}'` + else + cpuCore="1" + fi + # ----- cpu end ------ + + cd ${rootPath}/plugins/mysql/lib && /bin/bash rpcgen.sh + + INSTALL_CMD=cmake + # check cmake version + CMAKE_VERSION=`cmake -version | grep version | awk '{print $3}' | awk -F '.' '{print $1}'` + if [ "$CMAKE_VERSION" -eq "2" ];then + mkdir -p /var/log/mariadb + touch /var/log/mariadb/mariadb.log + INSTALL_CMD=cmake3 + fi + + if [ ! -f ${mysqlDir}/mysql-${VERSION}.tar.gz ];then + wget --no-check-certificate -O ${mysqlDir}/mysql-${VERSION}.tar.gz --tries=3 https://dev.mysql.com/get/Downloads/MySQL-9.4/mysql-${VERSION}.tar.gz + fi + + #检测文件是否损坏. + md5_mysql_ok=acabc8aa764a94a8b10f90284c6e60c5 + if [ -f ${mysqlDir}/mysql-${VERSION}.tar.gz ];then + md5_mysql=`md5sum ${mysqlDir}/mysql-${VERSION}.tar.gz | awk '{print $1}'` + if [ "${md5_mysql_ok}" == "${md5_mysql}" ]; then + echo "mysql9.4 file check ok" + else + # 重新下载 + rm -rf ${mysqlDir}/mysql-${VERSION} + wget --no-check-certificate -O ${mysqlDir}/mysql-${VERSION}.tar.gz --tries=3 https://dev.mysql.com/get/Downloads/MySQL-9.4/mysql-${VERSION}.tar.gz + fi + fi + + if [ ! -d ${mysqlDir}/mysql-${VERSION} ];then + cd ${mysqlDir} && tar -zxvf ${mysqlDir}/mysql-${VERSION}.tar.gz + fi + + OPTIONS='' + ##check openssl version + OPENSSL_VERSION=`openssl version|awk '{print $2}'|awk -F '.' '{print $1}'` + if [ "${OPENSSL_VERSION}" -ge "3" ];then + #openssl version to high + cd ${rootPath}/plugins/php/lib && /bin/bash openssl.sh + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig + OPTIONS="-DWITH_SSL=${serverPath}/lib/openssl" + fi + + WHERE_DIR_GCC=/usr/bin/gcc + WHERE_DIR_GPP=/usr/bin/g++ + if [ "$OSNAME" == "centos" ] && [ "$VERSION_ID" == "7" ];then + yum install -y libudev-devel + yum install -y centos-release-scl + yum install -y devtoolset-11-gcc devtoolset-11-gcc-c++ devtoolset-11-binutils + + gcc --version + WHERE_DIR_GCC=/opt/rh/devtoolset-11/root/usr/bin/gcc + WHERE_DIR_GPP=/opt/rh/devtoolset-11/root/usr/bin/g++ + echo $WHERE_DIR_GCC + echo $WHERE_DIR_GPP + fi + + if [ "$OSNAME" == "ubuntu" ];then + apt install -y libudev-dev + apt install -y libtirpc-dev + apt install -y libssl-dev + apt install -y libgssglue-dev + apt install -y software-properties-common + add-apt-repository -y ppa:ubuntu-toolchain-r/test + + LIBTIRPC_VER=`pkg-config libtirpc --modversion` + if [ ! -f ${mysqlDir}/libtirpc_1.3.3.orig.tar.bz2 ];then + wget --no-check-certificate -O ${mysqlDir}/libtirpc_1.3.3.orig.tar.bz2 https://downloads.sourceforge.net/libtirpc/libtirpc-1.3.3.tar.bz2 + cd ${mysqlDir} && tar -jxvf libtirpc_1.3.3.orig.tar.bz2 + cd libtirpc-1.3.3 && ./configure + fi + + export PKG_CONFIG_PATH=/usr/lib/pkgconfig + apt install -y gcc-11 g++-11 + WHERE_DIR_GCC=/usr/bin/gcc-11 + WHERE_DIR_GPP=/usr/bin/g++-11 + + + OPTIONS="${OPTIONS} -DFORCE_INSOURCE_BUILD=1" + OPTIONS="${OPTIONS} -D_FORTIFY_SOURCE=2" + fi + + + if [ "$OSNAME" == "opensuse" ];then + zypper install -y gcc11 + zypper install -y gcc11-c++ + + + WHERE_DIR_GCC=/usr/bin/gcc-11 + WHERE_DIR_GPP=/usr/bin/g++-11 + fi + + if [ ! -d $serverPath/mysql ];then + # -DCMAKE_CXX_STANDARD=17 \ + cd ${mysqlDir}/mysql-${VERSION} && ${INSTALL_CMD} \ + -DCMAKE_INSTALL_PREFIX=$serverPath/mysql \ + -DMYSQL_USER=mysql \ + -DMYSQL_TCP_PORT=3306 \ + -DMYSQL_UNIX_ADDR=/var/tmp/mysql.sock \ + -DWITH_MYISAM_STORAGE_ENGINE=1 \ + -DWITH_INNOBASE_STORAGE_ENGINE=1 \ + -DWITH_MEMORY_STORAGE_ENGINE=1 \ + -DENABLED_LOCAL_INFILE=1 \ + -DWITH_PARTITION_STORAGE_ENGINE=1 \ + -DWITH_READLINE=1 \ + -DEXTRA_CHARSETS=all \ + -DDEFAULT_CHARSET=utf8mb4 \ + -DDEFAULT_COLLATION=utf8mb4_general_ci \ + -DDOWNLOAD_BOOST=1 \ + -DFORCE_INSOURCE_BUILD=1 \ + $OPTIONS \ + -DCMAKE_C_COMPILER=$WHERE_DIR_GCC \ + -DCMAKE_CXX_COMPILER=$WHERE_DIR_GPP \ + -DDOWNLOAD_BOOST=0 \ + -DWITH_BOOST=${mysqlDir}/mysql-${VERSION}/boost/ + make -j${cpuCore} && make install && make clean + + if [ -d $serverPath/mysql ];then + rm -rf ${mysqlDir}/mysql-${VERSION} + echo '9.4' > $serverPath/mysql/version.pl + echo "${VERSION}安装完成" + else + # rm -rf ${mysqlDir}/mysql-${VERSION} + echo "${VERSION}安装失败" + exit 1 + fi + fi +} + +Uninstall_mysql() +{ + rm -rf $serverPath/mysql + echo '卸载完成' +} + +action=$1 +if [ "${1}" == "install" ];then + Install_mysql +else + Uninstall_mysql +fi From 0f67d1415311a023e6ce36b7c3367f88a63d8471 Mon Sep 17 00:00:00 2001 From: dami Date: Sat, 22 Nov 2025 18:25:50 +0800 Subject: [PATCH 03/12] Update install.sh --- plugins/mysql/versions/9.4/install.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/mysql/versions/9.4/install.sh b/plugins/mysql/versions/9.4/install.sh index f0aaffcaf0..3c8aecb0e5 100755 --- a/plugins/mysql/versions/9.4/install.sh +++ b/plugins/mysql/versions/9.4/install.sh @@ -55,8 +55,9 @@ VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk - VERSION=9.4.0 -# https://dev.mysql.com/get/Downloads/MySQL-9.2/mysql-${VERSION}.tar.gz -# https://cdn.mysql.com//Downloads/MySQL-9.2/mysql-boost-${VERSION}.tar.gz +# https://dev.mysql.com/get/Downloads/MySQL-9.4/mysql-${VERSION}.tar.gz +# https://cdn.mysql.com//Downloads/MySQL-9.4/mysql-boost-${VERSION}.tar.gz +# https://cdn.mysql.com/archives/mysql-9.4/mysql-9.4.0.tar.gz Install_mysql() { mkdir -p ${mysqlDir} @@ -103,6 +104,8 @@ Install_mysql() wget --no-check-certificate -O ${mysqlDir}/mysql-${VERSION}.tar.gz --tries=3 https://dev.mysql.com/get/Downloads/MySQL-9.4/mysql-${VERSION}.tar.gz fi + # https://cdn.mysql.com/archives/mysql-9.4/mysql-9.4.0.tar.gz + #检测文件是否损坏. md5_mysql_ok=acabc8aa764a94a8b10f90284c6e60c5 if [ -f ${mysqlDir}/mysql-${VERSION}.tar.gz ];then @@ -112,7 +115,7 @@ Install_mysql() else # 重新下载 rm -rf ${mysqlDir}/mysql-${VERSION} - wget --no-check-certificate -O ${mysqlDir}/mysql-${VERSION}.tar.gz --tries=3 https://dev.mysql.com/get/Downloads/MySQL-9.4/mysql-${VERSION}.tar.gz + wget --no-check-certificate -O ${mysqlDir}/mysql-${VERSION}.tar.gz --tries=3 https://cdn.mysql.com/archives/mysql-9.4/mysql-${VERSION}.tar.gz fi fi From ba1508a82abf2b21653b9886e6b04baba4db5895 Mon Sep 17 00:00:00 2001 From: dami Date: Sat, 22 Nov 2025 18:27:03 +0800 Subject: [PATCH 04/12] Update info.json --- plugins/mysql/info.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/mysql/info.json b/plugins/mysql/info.json index fad0ed962c..aa65aeedf9 100755 --- a/plugins/mysql/info.json +++ b/plugins/mysql/info.json @@ -11,8 +11,8 @@ "checks": "server/mysql/VERSION/bin/mysql", "path": "server/mysql/VERSION", "todo_versions":["5.6","5.7","8.0","8.2"], - "versions":["5.5", "5.6", "5.7","8.0","8.2","8.3","8.4","9.0","9.1","9.2","9.3"], - "updates":["5.5.62","5.6.50", "5.7.32","8.0.34","8.2.0","8.3.0","9.0.1","9.1.0","9.2.0","9.3.0"], + "versions":["5.5", "5.6", "5.7","8.0","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4"], + "updates":["5.5.62","5.6.50", "5.7.32","8.0.34","8.2.0","8.3.0","9.0.1","9.1.0","9.2.0","9.3.0","9.4.0"], "shell":"install.sh", "checks":"server/mysql", "path":"server/mysql", From 934a436065d5d88348b2aa787ac9160aa0c9dced Mon Sep 17 00:00:00 2001 From: dami Date: Sat, 22 Nov 2025 18:27:57 +0800 Subject: [PATCH 05/12] Update install.sh --- plugins/mysql/versions/9.4/install.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugins/mysql/versions/9.4/install.sh b/plugins/mysql/versions/9.4/install.sh index 3c8aecb0e5..0c40440ff4 100755 --- a/plugins/mysql/versions/9.4/install.sh +++ b/plugins/mysql/versions/9.4/install.sh @@ -56,7 +56,6 @@ VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk - VERSION=9.4.0 # https://dev.mysql.com/get/Downloads/MySQL-9.4/mysql-${VERSION}.tar.gz -# https://cdn.mysql.com//Downloads/MySQL-9.4/mysql-boost-${VERSION}.tar.gz # https://cdn.mysql.com/archives/mysql-9.4/mysql-9.4.0.tar.gz Install_mysql() { @@ -104,8 +103,6 @@ Install_mysql() wget --no-check-certificate -O ${mysqlDir}/mysql-${VERSION}.tar.gz --tries=3 https://dev.mysql.com/get/Downloads/MySQL-9.4/mysql-${VERSION}.tar.gz fi - # https://cdn.mysql.com/archives/mysql-9.4/mysql-9.4.0.tar.gz - #检测文件是否损坏. md5_mysql_ok=acabc8aa764a94a8b10f90284c6e60c5 if [ -f ${mysqlDir}/mysql-${VERSION}.tar.gz ];then From 471e655eb33f3b2fe207a8f6b0f5b827c29525d4 Mon Sep 17 00:00:00 2001 From: dami Date: Sat, 22 Nov 2025 18:33:50 +0800 Subject: [PATCH 06/12] Update install.sh --- plugins/mysql/versions/9.4/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mysql/versions/9.4/install.sh b/plugins/mysql/versions/9.4/install.sh index 0c40440ff4..d3615db3a0 100755 --- a/plugins/mysql/versions/9.4/install.sh +++ b/plugins/mysql/versions/9.4/install.sh @@ -104,7 +104,7 @@ Install_mysql() fi #检测文件是否损坏. - md5_mysql_ok=acabc8aa764a94a8b10f90284c6e60c5 + md5_mysql_ok=c770f276fb84019be6fbe0a57b32efbc if [ -f ${mysqlDir}/mysql-${VERSION}.tar.gz ];then md5_mysql=`md5sum ${mysqlDir}/mysql-${VERSION}.tar.gz | awk '{print $1}'` if [ "${md5_mysql_ok}" == "${md5_mysql}" ]; then From 476c73fed3f8f903921bef7a2bf83f9cf5a30e52 Mon Sep 17 00:00:00 2001 From: dami Date: Sat, 22 Nov 2025 23:56:35 +0800 Subject: [PATCH 07/12] update --- plugins/mariadb/versions/12.1/install.sh | 120 +++++++++++++++++++++++ plugins/mysql/conf/my9.3.cnf | 116 ++++++++++++++++++++++ plugins/mysql/conf/my9.4.cnf | 116 ++++++++++++++++++++++ 3 files changed, 352 insertions(+) create mode 100755 plugins/mariadb/versions/12.1/install.sh create mode 100644 plugins/mysql/conf/my9.3.cnf create mode 100644 plugins/mysql/conf/my9.4.cnf diff --git a/plugins/mariadb/versions/12.1/install.sh b/plugins/mariadb/versions/12.1/install.sh new file mode 100755 index 0000000000..2cf9a7bc1c --- /dev/null +++ b/plugins/mariadb/versions/12.1/install.sh @@ -0,0 +1,120 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin +export PATH + +#https://dev.mysql.com/downloads/mysql/5.5.html#downloads +#https://dev.mysql.com/downloads/file/?id=480541 + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sysName=`uname` + +mariadbDir=${serverPath}/source/mariadb + +MY_VER=12.1.2 + +Install_app() +{ + mkdir -p ${mariadbDir} + echo '正在安装脚本文件...' + + if [ "$sysName" != "Darwin" ];then + mkdir -p /var/log/mariadb + touch /var/log/mariadb/mariadb.log + fi + + # ----- cpu start ------ + if [ -z "${cpuCore}" ]; then + cpuCore="1" + fi + + if [ -f /proc/cpuinfo ];then + cpuCore=`cat /proc/cpuinfo | grep "processor" | wc -l` + fi + + MEM_INFO=$(free -m|grep Mem|awk '{printf("%.f",($2)/1024)}') + if [ "${cpuCore}" != "1" ] && [ "${MEM_INFO}" != "0" ];then + if [ "${cpuCore}" -gt "${MEM_INFO}" ];then + cpuCore="${MEM_INFO}" + fi + else + cpuCore="1" + fi + + if [ "$cpuCore" -gt "2" ];then + cpuCore=`echo "$cpuCore" | awk '{printf("%.f",($1)*0.8)}'` + else + cpuCore="1" + fi + # ----- cpu end ------ + + # if [ ! -f ${mariadbDir}/mariadb-${MY_VER}.tar.gz ];then + # wget --no-check-certificate -O ${mariadbDir}/mariadb-${MY_VER}.tar.gz --tries=3 https://mirrors.aliyun.com/mariadb/mariadb-${MY_VER}/source/mariadb-${MY_VER}.tar.gz + # fi + + # https://downloads.mariadb.org/interstitial/mariadb-10.9.1/source/mariadb-10.9.1.tar.gz + if [ ! -f ${mariadbDir}/mariadb-${MY_VER}.tar.gz ];then + wget --no-check-certificate -O ${mariadbDir}/mariadb-${MY_VER}.tar.gz --tries=3 https://archive.mariadb.org/mariadb-${MY_VER}/source/mariadb-${MY_VER}.tar.gz + fi + + if [ ! -d ${mariadbDir}/mariadb-${MY_VER} ];then + cd ${mariadbDir} && tar -zxvf ${mariadbDir}/mariadb-${MY_VER}.tar.gz + fi + + INSTALL_CMD=cmake + # check cmake version + CMAKE_VERSION=`cmake -version | grep version | awk '{print $3}' | awk -F '.' '{print $1}'` + if [ "$CMAKE_VERSION" -eq "2" ];then + mkdir -p /var/log/mariadb + touch /var/log/mariadb/mariadb.log + INSTALL_CMD=cmake3 + fi + + if [ ! -d $serverPath/mariadb ];then + cd ${mariadbDir}/mariadb-${MY_VER} && ${INSTALL_CMD} \ + -DCMAKE_INSTALL_PREFIX=$serverPath/mariadb \ + -DMYSQL_DATADIR=$serverPath/mariadb/data/ \ + -DMYSQL_USER=mysql \ + -DMYSQL_UNIX_ADDR=$serverPath/mariadb/mysql.sock \ + -DWITH_MYISAM_STORAGE_ENGINE=1 \ + -DWITH_INNOBASE_STORAGE_ENGINE=1 \ + -DWITH_MEMORY_STORAGE_ENGINE=1 \ + -DENABLED_LOCAL_INFILE=1 \ + -DWITH_PARTITION_STORAGE_ENGINE=1 \ + -DEXTRA_CHARSETS=all \ + -DDEFAULT_CHARSET=utf8mb4 \ + -DDEFAULT_COLLATION=utf8mb4_general_ci \ + -DCMAKE_C_COMPILER=/usr/bin/gcc \ + -DCMAKE_CXX_COMPILER=/usr/bin/g++ + make -j${cpuCore} && make install && make clean + + if [ -d $serverPath/mariadb ];then + echo '12.1' > $serverPath/mariadb/version.pl + echo '安装完成' + else + echo '安装失败' + echo 'install fail'>&2 + exit 1 + fi + fi + + if [ -d ${mariadbDir}/mariadb-${MY_VER} ];then + rm -rf ${mariadbDir}/mariadb-${MY_VER} + fi + +} + +Uninstall_app() +{ + rm -rf $serverPath/mariadb + echo '卸载完成' +} + +action=$1 +if [ "${1}" == 'install' ];then + Install_app +else + Uninstall_app +fi diff --git a/plugins/mysql/conf/my9.3.cnf b/plugins/mysql/conf/my9.3.cnf new file mode 100644 index 0000000000..87cb53435b --- /dev/null +++ b/plugins/mysql/conf/my9.3.cnf @@ -0,0 +1,116 @@ +[client] +user = root +#password = your_password +port = 3306 +socket = {$SERVER_APP_PATH}/mysql.sock +default-character-set = UTF8MB4 + +[mysqld] +!include {$SERVER_APP_PATH}/etc/mode/classic.cnf + +authentication_policy=caching_sha2_password +pid-file = {$SERVER_APP_PATH}/data/mysql.pid +user = mysql +port = 3306 +socket = {$SERVER_APP_PATH}/mysql.sock +basedir = {$SERVER_APP_PATH} +datadir = {$SERVER_APP_PATH}/data +log-error = {$SERVER_APP_PATH}/data/error.log +server-id = {$SERVER_ID} +#sql-mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES + +default_storage_engine = InnoDB + +key_buffer_size = 8M +table_open_cache = 32 +sort_buffer_size = 256K +net_buffer_length = 4K +read_buffer_size = 128K +read_rnd_buffer_size = 256K +myisam_sort_buffer_size = 4M +thread_cache_size = 4 +lower_case_table_names=0 +tmp_table_size = 8M +character-set-server = UTF8MB4 + +max_connections = 500 +max_connect_errors = 100 +open_files_limit = 2560 +max_allowed_packet = 128M + +skip_name_resolve=1 +#skip-networking +#skip-external-locking +#loose-skip-innodb +#skip-grant-tables + +#skip-log-bin +#disable-log-bin +#skip-slave-start +log-bin=mysql-bin +slow_query_log=1 +slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log +long_query_time=10 +#log_queries_not_using_indexes=1 +#log_slow_admin_statements=1 +#log_slow_replica_statements=1 +binlog_expire_logs_seconds=604800 + +relay-log=mdserver +relay-log-index=mdserver + +#多主设置 +#auto_increment_offset=2 +#auto_increment_increment=2 + +#master +#sync_binlog=1 + +#binlog-do-db +binlog-ignore-db = test +binlog-ignore-db = mysql +binlog-ignore-db = information_schema +binlog-ignore-db = performance_schema + +#slave +log_replica_updates = 1 +# Prevent replication from starting automatically with MySQL +#skip_replica_start = 1 +#replicate-do-db +replica_skip_errors=1062,1396 +replicate-ignore-db = information_schema +replicate-ignore-db = performance_schema +replicate-ignore-db = mysql +replicate-ignore-db = test + + +innodb_data_home_dir = {$SERVER_APP_PATH}/data +innodb_data_file_path = ibdata1:10M:autoextend +innodb_log_group_home_dir = {$SERVER_APP_PATH}/data +innodb_buffer_pool_size = 16M +#innodb_log_file_size = 5M +innodb_redo_log_capacity = 4G +innodb_log_buffer_size = 8M +innodb_flush_log_at_trx_commit = 1 +innodb_lock_wait_timeout = 120 +innodb_max_dirty_pages_pct = 90 +innodb_read_io_threads = 1 +innodb_write_io_threads = 1 +innodb_file_per_table=1 + +secure-file-priv={$SERVER_APP_PATH}/tmp + +[mysqldump] +quick + +[mysql] +no-auto-rehash + +[myisamchk] +key_buffer_size = 20M +sort_buffer_size = 20M +read_buffer = 2M +write_buffer = 2M + +[mysqlhotcopy] +interactive-timeout \ No newline at end of file diff --git a/plugins/mysql/conf/my9.4.cnf b/plugins/mysql/conf/my9.4.cnf new file mode 100644 index 0000000000..87cb53435b --- /dev/null +++ b/plugins/mysql/conf/my9.4.cnf @@ -0,0 +1,116 @@ +[client] +user = root +#password = your_password +port = 3306 +socket = {$SERVER_APP_PATH}/mysql.sock +default-character-set = UTF8MB4 + +[mysqld] +!include {$SERVER_APP_PATH}/etc/mode/classic.cnf + +authentication_policy=caching_sha2_password +pid-file = {$SERVER_APP_PATH}/data/mysql.pid +user = mysql +port = 3306 +socket = {$SERVER_APP_PATH}/mysql.sock +basedir = {$SERVER_APP_PATH} +datadir = {$SERVER_APP_PATH}/data +log-error = {$SERVER_APP_PATH}/data/error.log +server-id = {$SERVER_ID} +#sql-mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES + +default_storage_engine = InnoDB + +key_buffer_size = 8M +table_open_cache = 32 +sort_buffer_size = 256K +net_buffer_length = 4K +read_buffer_size = 128K +read_rnd_buffer_size = 256K +myisam_sort_buffer_size = 4M +thread_cache_size = 4 +lower_case_table_names=0 +tmp_table_size = 8M +character-set-server = UTF8MB4 + +max_connections = 500 +max_connect_errors = 100 +open_files_limit = 2560 +max_allowed_packet = 128M + +skip_name_resolve=1 +#skip-networking +#skip-external-locking +#loose-skip-innodb +#skip-grant-tables + +#skip-log-bin +#disable-log-bin +#skip-slave-start +log-bin=mysql-bin +slow_query_log=1 +slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log +long_query_time=10 +#log_queries_not_using_indexes=1 +#log_slow_admin_statements=1 +#log_slow_replica_statements=1 +binlog_expire_logs_seconds=604800 + +relay-log=mdserver +relay-log-index=mdserver + +#多主设置 +#auto_increment_offset=2 +#auto_increment_increment=2 + +#master +#sync_binlog=1 + +#binlog-do-db +binlog-ignore-db = test +binlog-ignore-db = mysql +binlog-ignore-db = information_schema +binlog-ignore-db = performance_schema + +#slave +log_replica_updates = 1 +# Prevent replication from starting automatically with MySQL +#skip_replica_start = 1 +#replicate-do-db +replica_skip_errors=1062,1396 +replicate-ignore-db = information_schema +replicate-ignore-db = performance_schema +replicate-ignore-db = mysql +replicate-ignore-db = test + + +innodb_data_home_dir = {$SERVER_APP_PATH}/data +innodb_data_file_path = ibdata1:10M:autoextend +innodb_log_group_home_dir = {$SERVER_APP_PATH}/data +innodb_buffer_pool_size = 16M +#innodb_log_file_size = 5M +innodb_redo_log_capacity = 4G +innodb_log_buffer_size = 8M +innodb_flush_log_at_trx_commit = 1 +innodb_lock_wait_timeout = 120 +innodb_max_dirty_pages_pct = 90 +innodb_read_io_threads = 1 +innodb_write_io_threads = 1 +innodb_file_per_table=1 + +secure-file-priv={$SERVER_APP_PATH}/tmp + +[mysqldump] +quick + +[mysql] +no-auto-rehash + +[myisamchk] +key_buffer_size = 20M +sort_buffer_size = 20M +read_buffer = 2M +write_buffer = 2M + +[mysqlhotcopy] +interactive-timeout \ No newline at end of file From 50a000f1c7b02545006f3122f80f47cbbc7d1311 Mon Sep 17 00:00:00 2001 From: dami Date: Sun, 23 Nov 2025 11:48:25 +0800 Subject: [PATCH 08/12] Update files.js --- web/static/app/files.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/static/app/files.js b/web/static/app/files.js index cbb4ef2e3b..ec0e809149 100755 --- a/web/static/app/files.js +++ b/web/static/app/files.js @@ -1464,7 +1464,7 @@ function unZip(fileName, type) { function isCompressFile(fileName){ var ext = fileName.split('.'); var extName = ext[ext.length-1].toLowerCase(); - var support = ['zip','gz','tgz','rar','7z','xz']; + var support = ['zip','gz','tgz','rar','7z','xz','bz2']; for (x in support) { if (support[x]==extName){ return true; From 575723b860ad9eff6b1a178d6801f9e175b00b22 Mon Sep 17 00:00:00 2001 From: dami Date: Sun, 23 Nov 2025 11:57:54 +0800 Subject: [PATCH 09/12] update --- web/static/app/files.js | 3 +++ web/utils/file.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/web/static/app/files.js b/web/static/app/files.js index ec0e809149..d089f8b512 100755 --- a/web/static/app/files.js +++ b/web/static/app/files.js @@ -1360,6 +1360,7 @@ function zip(dirName,submits) { \ \ \ + \ \ \ ' @@ -1397,6 +1398,8 @@ function zip(dirName,submits) { $("#dfile").val(newPathName + '.7z'); } else if (z_type == 'xz') { $("#dfile").val(newPathName + '.xz'); + } else if (z_type == 'bz2') { + $("#dfile").val(newPathName + '.tar.bz2'); } }); diff --git a/web/utils/file.py b/web/utils/file.py index 842bd269f8..4b51e4052d 100644 --- a/web/utils/file.py +++ b/web/utils/file.py @@ -177,6 +177,9 @@ def uncompress(sfile, dfile, path): elif extension == 'xz': cmd += "&& tar -Jxvf " + sfile + " -C " + dfile + " > " + tmps + " 2>&1 &" mw.execShell(cmd) + elif extension == 'bz2': + cmd += "&& tar -xjvf " + sfile + " -C " + dfile + " > " + tmps + " 2>&1 &" + mw.execShell(cmd) if os.path.exists(dfile): if dfile.startswith("/www/wwwroot"): From ffb6844a413c7e23e817e518705ddeb544208c9b Mon Sep 17 00:00:00 2001 From: dami Date: Sun, 23 Nov 2025 12:02:37 +0800 Subject: [PATCH 10/12] Update file.py --- web/utils/file.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/utils/file.py b/web/utils/file.py index 4b51e4052d..b8f005cc29 100644 --- a/web/utils/file.py +++ b/web/utils/file.py @@ -321,6 +321,8 @@ def zip(sfile, dfile, stype, path): if not mw.checkBinExist('rar'): return mw.returnData(False, 'rar压缩命令不存在,请安装!') mw.execShell("cd '" + path + "' && rar a '" + dfile + "' '" + sfile + "' > " + tmps + " 2>&1") + elif stype == 'bz2': + mw.execShell("cd '" + path + "' && tar -cjvf '" + dfile + "' " + sfiles + " > " + tmps + " 2>&1") else: return mw.returnData(False, '未知压缩格式') mw.writeLog("文件管理", '文件[{1}]压缩[{2}]成功!', (sfile, dfile)) @@ -346,6 +348,8 @@ def zip(sfile, dfile, stype, path): if not mw.checkBinExist('rar'): return mw.returnData(False, 'rar压缩命令不存在,请安装!') mw.execShell("cd '" + path + "' && rar a '" + dfile + "' " + sfiles + " > " + tmps + " 2>&1") + elif stype == 'bz2': + mw.execShell("cd '" + path + "' && tar -cjvf '" + dfile + "' " + sfiles + " > " + tmps + " 2>&1") else: return mw.returnData(False, '未知压缩格式') From 216a3d5d603ac91fb57adb0c8cff3e7873bcf6a8 Mon Sep 17 00:00:00 2001 From: dami Date: Sun, 23 Nov 2025 12:03:38 +0800 Subject: [PATCH 11/12] Update file.py --- web/utils/file.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/utils/file.py b/web/utils/file.py index b8f005cc29..2554602c52 100644 --- a/web/utils/file.py +++ b/web/utils/file.py @@ -147,8 +147,8 @@ def uncompress(sfile, dfile, path): if suffix_gz == tar_gz: extension = suffix_gz - if not extension in ['tar.gz', 'gz', 'zip', 'rar', '7z', 'xz']: - return mw.returnData(False, '现在仅支持gz,zip,rar,7z,xz格式解压!') + if not extension in ['tar.gz', 'gz', 'zip', 'rar', '7z', 'xz','bz2']: + return mw.returnData(False, '现在仅支持gz,zip,rar,7z,xz,bz2格式解压!') if extension == 'rar' and not mw.checkBinExist('rar'): return mw.returnData(False, 'rar解压命令不存在,请安装!') From 7ef3971fe153210770f027164f452196f4734ee9 Mon Sep 17 00:00:00 2001 From: dami Date: Sun, 23 Nov 2025 17:41:30 +0800 Subject: [PATCH 12/12] Update file.py --- web/utils/file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/utils/file.py b/web/utils/file.py index 2554602c52..f124b84bac 100644 --- a/web/utils/file.py +++ b/web/utils/file.py @@ -322,7 +322,7 @@ def zip(sfile, dfile, stype, path): return mw.returnData(False, 'rar压缩命令不存在,请安装!') mw.execShell("cd '" + path + "' && rar a '" + dfile + "' '" + sfile + "' > " + tmps + " 2>&1") elif stype == 'bz2': - mw.execShell("cd '" + path + "' && tar -cjvf '" + dfile + "' " + sfiles + " > " + tmps + " 2>&1") + mw.execShell("cd '" + path + "' && tar -cjvf '" + dfile + "' " + sfile + " > " + tmps + " 2>&1") else: return mw.returnData(False, '未知压缩格式') mw.writeLog("文件管理", '文件[{1}]压缩[{2}]成功!', (sfile, dfile))