diff --git a/plugins/mysql-apt/install.sh b/plugins/mysql-apt/install.sh index 701a0866e..0bd1fd3b1 100755 --- a/plugins/mysql-apt/install.sh +++ b/plugins/mysql-apt/install.sh @@ -7,8 +7,10 @@ rootPath=$(dirname "$curPath") rootPath=$(dirname "$rootPath") serverPath=$(dirname "$rootPath") +# https://dev.mysql.com/downloads/mysql/ # https://downloads.mysql.com/archives/community/ + # /www/server/mysql-apt/bin/usr/sbin/mysqld --basedir=/www/server/mysql-apt/bin/usr --datadir=/www/server/mysql-apt/data --initialize-insecure --explicit_defaults_for_timestamp @@ -18,8 +20,6 @@ serverPath=$(dirname "$rootPath") # cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-apt/index.py fix_db_access # cd /www/server/mdserver-web && source bin/activate && python3 plugins/mysql/index.py do_full_sync {"db":"xxx","sign":"","begin":1} - - action=$1 type=$2 @@ -58,11 +58,7 @@ if [ "${action}" == "uninstall" ];then fi -if [ "$2" == "8.4" ];then - sh -x $curPath/versions/$2/install_generic.sh $1 -else - sh -x $curPath/versions/$2/install.sh $1 -fi +sh -x $curPath/versions/$2/install_generic.sh $1 if [ "${action}" == "install" ];then #初始化 diff --git a/plugins/mysql-apt/versions/5.7/install_generic.sh b/plugins/mysql-apt/versions/5.7/install_generic.sh new file mode 100755 index 000000000..583790c49 --- /dev/null +++ b/plugins/mysql-apt/versions/5.7/install_generic.sh @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- +#!/bin/bash + +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH +export DEBIAN_FRONTEND=noninteractive + +# https://downloads.mysql.com/archives/community/ + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sysName=`uname` + +myDir=${serverPath}/source/mysql-apt + +OS_ARCH=`arch` +MYSQL_VER=5.7.39 +SUFFIX_NAME=${MYSQL_VER}-linux-glibc2.28-${OS_ARCH} + +# cd /www/server/mdserver-web/plugins/mysql-apt && bash install.sh install 5.7 +# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-apt/index.py start 5.7 +APT_INSTALL() +{ + +######## +mkdir -p $myDir +mkdir -p $serverPath/mysql-apt + +# Linux - Generic +if [ ! -f ${myDir}/mysql-${SUFFIX_NAME}.tar.xz ];then + wget --no-check-certificate -O ${myDir}/mysql-${SUFFIX_NAME}.tar.xz https://cdn.mysql.com/archives/mysql-5.7/mysql-${SUFFIX_NAME}.tar.xz +fi + +if [ -d ${myDir} ];then + cd ${myDir} && tar -Jxf ${myDir}/mysql-${SUFFIX_NAME}.tar.xz + cp -rf ${myDir}/mysql-${SUFFIX_NAME}/* $serverPath/mysql-apt +fi + +# 测试时可关闭 +rm -rf $myDir/mysql-${SUFFIX_NAME} +####### +} + +APT_UNINSTALL() +{ +### +rm -rf $myDir/mysql-${SUFFIX_NAME} +### +} + + +Install_mysql() +{ + echo '正在安装脚本文件...' + + isApt=`which apt` + if [ "$isApt" != "" ];then + APT_INSTALL + fi + + if [ "$?" == "0" ];then + mkdir -p $serverPath/mysql-apt + echo '5.7' > $serverPath/mysql-apt/version.pl + echo '安装完成' + else + echo '5.7' > $serverPath/mysql-apt/version.pl + echo "暂时不支持该系统" + fi +} + +Uninstall_mysql() +{ + + isApt=`which apt` + if [ "$isApt" != "" ];then + APT_UNINSTALL + fi + + rm -rf $serverPath/mysql-apt + echo '卸载完成' +} + +action=$1 +if [ "${1}" == 'install' ];then + Install_mysql +else + Uninstall_mysql +fi diff --git a/plugins/mysql-apt/versions/8.0/install.sh b/plugins/mysql-apt/versions/8.0/install.sh index 75ab8ab16..082460a6e 100755 --- a/plugins/mysql-apt/versions/8.0/install.sh +++ b/plugins/mysql-apt/versions/8.0/install.sh @@ -45,7 +45,7 @@ if [ "$ARCH" != "amd64" ];then fi -MYSQL_VER=8.0.36 +MYSQL_VER=8.0.39 SUFFIX_NAME=${MYSQL_VER}-1${OSNAME}${VERSION_ID}_${ARCH} diff --git a/plugins/mysql-apt/versions/8.0/install_generic.sh b/plugins/mysql-apt/versions/8.0/install_generic.sh new file mode 100755 index 000000000..5a080cd69 --- /dev/null +++ b/plugins/mysql-apt/versions/8.0/install_generic.sh @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- +#!/bin/bash + +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH +export DEBIAN_FRONTEND=noninteractive + +# https://downloads.mysql.com/archives/community/ + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sysName=`uname` + +myDir=${serverPath}/source/mysql-apt + +OS_ARCH=`arch` +MYSQL_VER=8.0.39 +SUFFIX_NAME=${MYSQL_VER}-linux-glibc2.28-${OS_ARCH} + +# cd /www/server/mdserver-web/plugins/mysql-apt && bash install.sh install 8.0 +# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-apt/index.py start 8.0 +APT_INSTALL() +{ + +######## +mkdir -p $myDir +mkdir -p $serverPath/mysql-apt + +# Linux - Generic +if [ ! -f ${myDir}/mysql-${SUFFIX_NAME}.tar.xz ];then + wget --no-check-certificate -O ${myDir}/mysql-${SUFFIX_NAME}.tar.xz https://cdn.mysql.com/archives/mysql-8.0/mysql-${SUFFIX_NAME}.tar.xz +fi + +if [ -d ${myDir} ];then + cd ${myDir} && tar -Jxf ${myDir}/mysql-${SUFFIX_NAME}.tar.xz + cp -rf ${myDir}/mysql-${SUFFIX_NAME}/* $serverPath/mysql-apt +fi + +# 测试时可关闭 +rm -rf $myDir/mysql-${SUFFIX_NAME} +####### +} + +APT_UNINSTALL() +{ +### +rm -rf $myDir/mysql-${SUFFIX_NAME} +### +} + + +Install_mysql() +{ + echo '正在安装脚本文件...' + + isApt=`which apt` + if [ "$isApt" != "" ];then + APT_INSTALL + fi + + if [ "$?" == "0" ];then + mkdir -p $serverPath/mysql-apt + echo '8.0' > $serverPath/mysql-apt/version.pl + echo '安装完成' + else + echo '8.0' > $serverPath/mysql-apt/version.pl + echo "暂时不支持该系统" + fi +} + +Uninstall_mysql() +{ + + isApt=`which apt` + if [ "$isApt" != "" ];then + APT_UNINSTALL + fi + + rm -rf $serverPath/mysql-apt + echo '卸载完成' +} + +action=$1 +if [ "${1}" == 'install' ];then + Install_mysql +else + Uninstall_mysql +fi diff --git a/plugins/mysql-apt/versions/8.2/install_generic.sh b/plugins/mysql-apt/versions/8.2/install_generic.sh new file mode 100755 index 000000000..769c58398 --- /dev/null +++ b/plugins/mysql-apt/versions/8.2/install_generic.sh @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- +#!/bin/bash + +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH +export DEBIAN_FRONTEND=noninteractive + +# https://downloads.mysql.com/archives/community/ + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sysName=`uname` + +myDir=${serverPath}/source/mysql-apt + +OS_ARCH=`arch` +MYSQL_VER=8.2.0 +SUFFIX_NAME=${MYSQL_VER}-linux-glibc2.28-${OS_ARCH} + +# cd /www/server/mdserver-web/plugins/mysql-apt && bash install.sh install 8.2 +# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-apt/index.py start 8.2 +APT_INSTALL() +{ + +######## +mkdir -p $myDir +mkdir -p $serverPath/mysql-apt + +# Linux - Generic +if [ ! -f ${myDir}/mysql-${SUFFIX_NAME}.tar.xz ];then + wget --no-check-certificate -O ${myDir}/mysql-${SUFFIX_NAME}.tar.xz https://cdn.mysql.com/archives/mysql-8.2/mysql-${SUFFIX_NAME}.tar.xz +fi + +if [ -d ${myDir} ];then + cd ${myDir} && tar -Jxf ${myDir}/mysql-${SUFFIX_NAME}.tar.xz + cp -rf ${myDir}/mysql-${SUFFIX_NAME}/* $serverPath/mysql-apt +fi + +# 测试时可关闭 +rm -rf $myDir/mysql-${SUFFIX_NAME} +####### +} + +APT_UNINSTALL() +{ +### +rm -rf $myDir/mysql-${SUFFIX_NAME} +### +} + + +Install_mysql() +{ + echo '正在安装脚本文件...' + + isApt=`which apt` + if [ "$isApt" != "" ];then + APT_INSTALL + fi + + if [ "$?" == "0" ];then + mkdir -p $serverPath/mysql-apt + echo '8.2' > $serverPath/mysql-apt/version.pl + echo '安装完成' + else + echo '8.2' > $serverPath/mysql-apt/version.pl + echo "暂时不支持该系统" + fi +} + +Uninstall_mysql() +{ + + isApt=`which apt` + if [ "$isApt" != "" ];then + APT_UNINSTALL + fi + + rm -rf $serverPath/mysql-apt + echo '卸载完成' +} + +action=$1 +if [ "${1}" == 'install' ];then + Install_mysql +else + Uninstall_mysql +fi diff --git a/plugins/mysql-apt/versions/8.3/install_generic.sh b/plugins/mysql-apt/versions/8.3/install_generic.sh new file mode 100755 index 000000000..c451fbd36 --- /dev/null +++ b/plugins/mysql-apt/versions/8.3/install_generic.sh @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- +#!/bin/bash + +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH +export DEBIAN_FRONTEND=noninteractive + +# https://downloads.mysql.com/archives/community/ + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sysName=`uname` + +myDir=${serverPath}/source/mysql-apt + +OS_ARCH=`arch` +MYSQL_VER=8.3.0 +SUFFIX_NAME=${MYSQL_VER}-linux-glibc2.28-${OS_ARCH} + +# cd /www/server/mdserver-web/plugins/mysql-apt && bash install.sh install 8.3 +# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-apt/index.py start 8.3 +APT_INSTALL() +{ + +######## +mkdir -p $myDir +mkdir -p $serverPath/mysql-apt + +# Linux - Generic +if [ ! -f ${myDir}/mysql-${SUFFIX_NAME}.tar.xz ];then + wget --no-check-certificate -O ${myDir}/mysql-${SUFFIX_NAME}.tar.xz https://cdn.mysql.com/archives/mysql-8.3/mysql-${SUFFIX_NAME}.tar.xz +fi + +if [ -d ${myDir} ];then + cd ${myDir} && tar -Jxf ${myDir}/mysql-${SUFFIX_NAME}.tar.xz + cp -rf ${myDir}/mysql-${SUFFIX_NAME}/* $serverPath/mysql-apt +fi + +# 测试时可关闭 +rm -rf $myDir/mysql-${SUFFIX_NAME} +####### +} + +APT_UNINSTALL() +{ +### +rm -rf $myDir/mysql-${SUFFIX_NAME} +### +} + + +Install_mysql() +{ + echo '正在安装脚本文件...' + + isApt=`which apt` + if [ "$isApt" != "" ];then + APT_INSTALL + fi + + if [ "$?" == "0" ];then + mkdir -p $serverPath/mysql-apt + echo '8.3' > $serverPath/mysql-apt/version.pl + echo '安装完成' + else + echo '8.3' > $serverPath/mysql-apt/version.pl + echo "暂时不支持该系统" + fi +} + +Uninstall_mysql() +{ + + isApt=`which apt` + if [ "$isApt" != "" ];then + APT_UNINSTALL + fi + + rm -rf $serverPath/mysql-apt + echo '卸载完成' +} + +action=$1 +if [ "${1}" == 'install' ];then + Install_mysql +else + Uninstall_mysql +fi diff --git a/plugins/mysql-apt/versions/8.4/install_generic.sh b/plugins/mysql-apt/versions/8.4/install_generic.sh index 1370fe885..5932cb0fa 100755 --- a/plugins/mysql-apt/versions/8.4/install_generic.sh +++ b/plugins/mysql-apt/versions/8.4/install_generic.sh @@ -15,29 +15,16 @@ sysName=`uname` myDir=${serverPath}/source/mysql-apt +OS_ARCH=`arch` +MYSQL_VER=8.4.2 +SUFFIX_NAME=${MYSQL_VER}-linux-glibc2.28-${OS_ARCH} + # cd /www/server/mdserver-web/plugins/mysql-apt && bash install.sh install 8.4 # cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-apt/index.py start 8.4 APT_INSTALL() { -ARCH="amd64" -TMP_ARCH=`arch` -if [ "$TMP_ARCH" == "x86_64" ];then - ARCH="amd64" -elif [ "$TMP_ARCH" == "aarch64" ];then - ARCH="arm64" -else - ARCH="amd64" -fi -if [ "$ARCH" != "amd64" ];then - echo "暂时不支持该${ARCH}" - exit 1 -fi - - -MYSQL_VER=8.4.2 -SUFFIX_NAME=${MYSQL_VER}-linux-glibc2.28-${TMP_ARCH} ######## mkdir -p $myDir @@ -62,8 +49,7 @@ rm -rf $myDir/mysql-${SUFFIX_NAME} APT_UNINSTALL() { ### -rm -rf $myDir -# apt remove -y mysql-server +rm -rf $myDir/mysql-${SUFFIX_NAME} ### } diff --git a/plugins/mysql-apt/versions/9.0/install_generic.sh b/plugins/mysql-apt/versions/9.0/install_generic.sh index c3ea97b92..2a8cf5868 100755 --- a/plugins/mysql-apt/versions/9.0/install_generic.sh +++ b/plugins/mysql-apt/versions/9.0/install_generic.sh @@ -14,30 +14,15 @@ sysName=`uname` myDir=${serverPath}/source/mysql-apt +OS_ARCH=`arch` +MYSQL_VER=9.0.1 +SUFFIX_NAME=${MYSQL_VER}-linux-glibc2.28-${OS_ARCH} + # cd /www/server/mdserver-web/plugins/mysql-apt && bash install.sh install 9.0 # cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-apt/index.py start 9.0 APT_INSTALL() { -ARCH="amd64" -TMP_ARCH=`arch` -if [ "$TMP_ARCH" == "x86_64" ];then - ARCH="amd64" -elif [ "$TMP_ARCH" == "aarch64" ];then - ARCH="arm64" -else - ARCH="amd64" -fi - -if [ "$ARCH" != "amd64" ];then - echo "暂时不支持该${ARCH}" - exit 1 -fi - - -MYSQL_VER=9.0.1 -SUFFIX_NAME=${MYSQL_VER}-linux-glibc2.28-${TMP_ARCH} - ######## mkdir -p $myDir mkdir -p $serverPath/mysql-apt @@ -61,8 +46,7 @@ rm -rf $myDir/mysql-${SUFFIX_NAME} APT_UNINSTALL() { ### -rm -rf $myDir -# apt remove -y mysql-server +rm -rf $myDir/mysql-${SUFFIX_NAME} ### } diff --git a/plugins/mysql-apt/versions/9.1/install_generic.sh b/plugins/mysql-apt/versions/9.1/install_generic.sh index 1370fe885..582611d9e 100755 --- a/plugins/mysql-apt/versions/9.1/install_generic.sh +++ b/plugins/mysql-apt/versions/9.1/install_generic.sh @@ -15,38 +15,24 @@ sysName=`uname` myDir=${serverPath}/source/mysql-apt +OS_ARCH=`arch` +MYSQL_VER=9.1.0 +SUFFIX_NAME=${MYSQL_VER}-linux-glibc2.28-${OS_ARCH} + # cd /www/server/mdserver-web/plugins/mysql-apt && bash install.sh install 8.4 # cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-apt/index.py start 8.4 APT_INSTALL() { -ARCH="amd64" -TMP_ARCH=`arch` -if [ "$TMP_ARCH" == "x86_64" ];then - ARCH="amd64" -elif [ "$TMP_ARCH" == "aarch64" ];then - ARCH="arm64" -else - ARCH="amd64" -fi - -if [ "$ARCH" != "amd64" ];then - echo "暂时不支持该${ARCH}" - exit 1 -fi - - -MYSQL_VER=8.4.2 -SUFFIX_NAME=${MYSQL_VER}-linux-glibc2.28-${TMP_ARCH} - ######## mkdir -p $myDir mkdir -p $serverPath/mysql-apt # Linux - Generic # https://cdn.mysql.com/archives/mysql-8.4/mysql-8.4.2-linux-glibc2.28-x86_64.tar.xz +# https://cdn.mysql.com/Downloads/MySQL-9.1/mysql-mysql-${SUFFIX_NAME}.tar.xz if [ ! -f ${myDir}/mysql-${SUFFIX_NAME}.tar.xz ];then - wget --no-check-certificate -O ${myDir}/mysql-${SUFFIX_NAME}.tar.xz https://cdn.mysql.com/archives/mysql-8.4/mysql-${SUFFIX_NAME}.tar.xz + wget --no-check-certificate -O ${myDir}/mysql-${SUFFIX_NAME}.tar.xz https://cdn.mysql.com/Downloads/MySQL-9.1/mysql-mysql-${SUFFIX_NAME}.tar.xz fi if [ -d ${myDir} ];then @@ -62,7 +48,7 @@ rm -rf $myDir/mysql-${SUFFIX_NAME} APT_UNINSTALL() { ### -rm -rf $myDir +rm -rf $myDir/mysql-${SUFFIX_NAME} # apt remove -y mysql-server ### } @@ -79,10 +65,10 @@ Install_mysql() if [ "$?" == "0" ];then mkdir -p $serverPath/mysql-apt - echo '8.4' > $serverPath/mysql-apt/version.pl + echo '9.1' > $serverPath/mysql-apt/version.pl echo '安装完成' else - echo '8.4' > $serverPath/mysql-apt/version.pl + echo '9.1' > $serverPath/mysql-apt/version.pl echo "暂时不支持该系统" fi }