diff --git a/plugins/data_query/sql_mysql.py b/plugins/data_query/sql_mysql.py index 93cc6c0ed2..66bd7febc5 100755 --- a/plugins/data_query/sql_mysql.py +++ b/plugins/data_query/sql_mysql.py @@ -84,7 +84,7 @@ def get_options(self, sid=None): result['host'] = '127.0.0.1' result['username'] = 'root' - if sid in ['mysql', 'mysql-apt', 'mysql-yum']: + if sid in ['mysql', 'mysql-apt', 'mysql-yum', 'mysql-community']: my_cnf_path = "{}/{}/etc/my.cnf".format(mw.getServerDir(),sid) if not os.path.exists(my_cnf_path): return False @@ -132,6 +132,10 @@ def getServerList(self): local_mysql_yum = "{}/mysql-yum/etc/my.cnf".format(mw.getServerDir()) if os.path.exists(local_mysql_yum): data.append({'name':'本地服务器[yum]', 'val':'mysql-yum'}) + + local_mysql_yum = "{}/mysql-community/etc/my.cnf".format(mw.getServerDir()) + if os.path.exists(local_mysql_yum): + data.append({'name':'本地服务器[community]', 'val':'mysql-community'}) return mw.returnData(True, 'ok', data) @singleton diff --git a/plugins/mysql-apt/index_mysql_apt.py b/plugins/mysql-apt/index_mysql_apt.py deleted file mode 100644 index d252c1cea2..0000000000 --- a/plugins/mysql-apt/index_mysql_apt.py +++ /dev/null @@ -1,189 +0,0 @@ -# coding:utf-8 - -import sys -import io -import os -import time -import subprocess -import re -import json - -web_dir = os.getcwd() + "/web" -if os.path.exists(web_dir): - sys.path.append(web_dir) - os.chdir(web_dir) - -import core.mw as mw - -if mw.isAppleSystem(): - cmd = 'ls /usr/local/lib/ | grep python | cut -d \\ -f 1 | awk \'END {print}\'' - info = mw.execShell(cmd) - p = "/usr/local/lib/" + info[0].strip() + "/site-packages" - sys.path.append(p) - - -app_debug = False -if mw.isAppleSystem(): - app_debug = True - - -def getPluginName(): - return 'mysql-apt' - - -def getPluginDir(): - return mw.getPluginDir() + '/' + getPluginName() - - -def getSPluginDir(): - return '/www/server/mdserver-web/plugins/' + getPluginName() - - -def getServerDir(): - return mw.getServerDir() + '/' + getPluginName() - - -def getConf(): - path = getServerDir() + '/etc/my.cnf' - return path - - -def getDataDir(): - file = getConf() - content = mw.readFile(file) - rep = r'datadir\s*=\s*(.*)' - tmp = re.search(rep, content) - return tmp.groups()[0].strip() - - -def getRelayLogName(): - file = getConf() - content = mw.readFile(file) - rep = r'relay-log\s*=\s*(.*)' - tmp = re.search(rep, content) - return tmp.groups()[0].strip() - - -def getLogBinName(): - file = getConf() - content = mw.readFile(file) - rep = r'log-bin\s*=\s*(.*)' - tmp = re.search(rep, content) - return tmp.groups()[0].strip() - - -def binLogListLook(args): - - file = args['file'] - line = args['line'] - - data_dir = getDataDir() - my_bin = getServerDir() + '/bin/usr/bin' - my_binlog_cmd = my_bin + '/mysqlbinlog' - - cmd = my_binlog_cmd + ' --no-defaults ' + \ - data_dir + '/' + file + '|tail -' + str(line) - - data = mw.execShell(cmd) - - rdata = {} - rdata['cmd'] = cmd - rdata['data'] = data[0] - - return rdata - - -def binLogListLookDecode(args): - - file = args['file'] - line = args['line'] - - data_dir = getDataDir() - my_bin = getServerDir() + '/bin/usr/bin' - my_binlog_cmd = my_bin + '/mysqlbinlog' - - cmd = my_binlog_cmd + ' --no-defaults --base64-output=decode-rows -vvvv ' + \ - data_dir + '/' + file + '|tail -' + str(line) - - data = mw.execShell(cmd) - - rdata = {} - rdata['cmd'] = cmd - rdata['data'] = data[0] - - return rdata - - -def binLogListTraceRelay(args): - rdata = {} - file = args['file'] - line = args['line'] - - relay_name = getRelayLogName() - data_dir = getDataDir() - alist = os.listdir(data_dir) - relay_list = [] - for x in range(len(alist)): - f = alist[x] - t = {} - if f.startswith(relay_name) and not f.endswith('.index'): - relay_list.append(f) - - relay_list = sorted(relay_list, reverse=True) - if len(relay_list) == 0: - rdata['cmd'] = '' - rdata['data'] = '无Relay日志' - return rdata - - file = relay_list[0] - - my_bin = getServerDir() + '/bin/usr/bin' - my_binlog_cmd = my_bin + '/mysqlbinlog' - - cmd = my_binlog_cmd + ' --no-defaults --base64-output=decode-rows -vvvv ' + \ - data_dir + '/' + file + '|tail -' + str(line) - - data = mw.execShell(cmd) - - rdata['cmd'] = cmd - rdata['data'] = data[0] - - return rdata - - -def binLogListTraceBinLog(args): - rdata = {} - file = args['file'] - line = args['line'] - - data_dir = getDataDir() - log_bin_name = getLogBinName() - - alist = os.listdir(data_dir) - log_bin_l = [] - for x in range(len(alist)): - f = alist[x] - t = {} - if f.startswith(log_bin_name) and not f.endswith('.index'): - log_bin_l.append(f) - - if len(log_bin_l) == 0: - rdata['cmd'] = '' - rdata['data'] = '无BINLOG' - return rdata - - log_bin_l = sorted(log_bin_l, reverse=True) - file = log_bin_l[0] - - my_bin = getServerDir() + '/bin/usr/bin' - my_binlog_cmd = my_bin + '/mysqlbinlog' - - cmd = my_binlog_cmd + ' --no-defaults --base64-output=decode-rows -vvvv ' + \ - data_dir + '/' + file + '|tail -' + str(line) - - data = mw.execShell(cmd) - - rdata['cmd'] = cmd - rdata['data'] = data[0] - - return rdata diff --git a/plugins/mysql-apt/install.sh b/plugins/mysql-apt/install.sh deleted file mode 100755 index 592dca39bb..0000000000 --- a/plugins/mysql-apt/install.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash -PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin -export PATH - -curPath=`pwd` -rootPath=$(dirname "$curPath") -rootPath=$(dirname "$rootPath") -serverPath=$(dirname "$rootPath") - -# 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 - - -# cd /www/server/mdserver-web/plugins/mysql-apt && bash install.sh install 8.0 -# cd /www/server/mdserver-web/plugins/mysql-apt && bash install.sh uninstall 8.0 -# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-apt/index.py start 5.7 -# 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 - -if id mysql &> /dev/null ;then - echo "mysql UID is `id -u mysql`" - echo "mysql Shell is `grep "^mysql:" /etc/passwd |cut -d':' -f7 `" -else - groupadd mysql - useradd -g mysql -s /usr/sbin/nologin mysql -fi - - -if [ "${2}" == "" ];then - echo '缺少安装脚本...' - exit 0 -fi - -if [ ! -d $curPath/versions/$2 ];then - echo '缺少安装脚本2...' - exit 0 -fi - -if [ "${action}" == "uninstall" ];then - - cd ${rootPath} && python3 ${rootPath}/plugins/mysql-apt/index.py stop ${type} - cd ${rootPath} && python3 ${rootPath}/plugins/mysql-apt/index.py initd_uninstall ${type} - cd $curPath - - if [ -f /usr/lib/systemd/system/mysql-apt.service ] || [ -f /lib/systemd/system/mysql-apt.service ];then - systemctl stop mysql-apt - systemctl disable mysql-apt - rm -rf /usr/lib/systemd/system/mysql-apt.service - rm -rf /lib/systemd/system/mysql-apt.service - systemctl daemon-reload - fi -fi - -sh -x $curPath/versions/$2/install.sh $1 - -if [ "${action}" == "install" ];then - #初始化 - - if [ "$?" != "0" ];then - exit $? - fi - cd ${rootPath} && python3 ${rootPath}/plugins/mysql-apt/index.py start ${type} - cd ${rootPath} && python3 ${rootPath}/plugins/mysql-apt/index.py initd_install ${type} -fi diff --git a/plugins/mysql-apt/versions/5.7/install.sh b/plugins/mysql-apt/versions/5.7/install.sh deleted file mode 100755 index 1d2a70c432..0000000000 --- a/plugins/mysql-apt/versions/5.7/install.sh +++ /dev/null @@ -1,132 +0,0 @@ -# -*- 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/ - -# debug -# 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 -# /www/server/mysql-apt/bin/usr/sbin/mysqld --defaults-file=/www/server/mysql-apt/etc/my.cnf --daemonize -# /www/server/mysql-apt/bin/usr/bin/mysql -S /www/server/mysql-apt/mysql.sock -uroot -p - -curPath=`pwd` -rootPath=$(dirname "$curPath") -rootPath=$(dirname "$rootPath") -serverPath=$(dirname "$rootPath") -sysName=`uname` - -myDir=${serverPath}/source/mysql-apt - -bash ${rootPath}/scripts/getos.sh -OSNAME=`cat ${rootPath}/data/osname.pl` -VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` - -MYSQL_VER=5.7.39 -if [ "$OSNAME" == "debian" ];then - # mysql5.7现在仅有10的编译版 - VERSION_ID="10" -fi - -if [ "$OSNAME" == "ubuntu" ];then - # mysql5.7现在仅有18.04的编译版 - VERSION_ID="18.04" -fi - -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 0 -fi - -SUFFIX_NAME=${MYSQL_VER}-1${OSNAME}${VERSION_ID}_${ARCH} - -APT_INSTALL() -{ -######## -mkdir -p $myDir -mkdir -p $serverPath/mysql-apt/bin - -wget --no-check-certificate -O ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar https://cdn.mysql.com/archives/mysql-5.7/mysql-server_${SUFFIX_NAME}.deb-bundle.tar -chmod +x ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar -cd ${myDir} && tar vxf ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar - -apt update -y -apt install -y libnuma1 libaio1 libmecab2 - -# 安装 -dpkg -X mysql-common_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - - -dpkg -X mysql-community-client-plugins_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-community-client-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-community-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - -dpkg -X mysql-community-server-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - -dpkg -X mysql-community-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - -# 测试时可关闭 -rm -rf $myDir -####### -} - -APT_UNINSTALL() -{ -### -rm -rf $myDir -# apt remove -y mysql-server -### -} - - -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 "暂时不支持该系统" - 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 deleted file mode 100755 index 75ab8ab167..0000000000 --- a/plugins/mysql-apt/versions/8.0/install.sh +++ /dev/null @@ -1,137 +0,0 @@ -# -*- 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 - -bash ${rootPath}/scripts/getos.sh -OSNAME=`cat ${rootPath}/data/osname.pl` -VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` - -# 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 - -# 暂时debian12没有标准版,先用11使用 -# if [ "$OSNAME" == 'debian' ] && [ "$VERSION_ID" == '12' ] ;then -# echo "暂时不支持该${OSNAME}${VERSION_ID}" -# exit 1 -# fi - - -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.0.36 -SUFFIX_NAME=${MYSQL_VER}-1${OSNAME}${VERSION_ID}_${ARCH} - - -# /lib/systemd/system/mysql.service -# /etc/mysql/my.cnf - -APT_INSTALL() -{ -######## -mkdir -p $myDir -mkdir -p $serverPath/mysql-apt/bin - - -mkdir -p /var/run/mysqld -chown mysql -R /var/run/mysqld - -wget --no-check-certificate -O ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar https://cdn.mysql.com/archives/mysql-8.0/mysql-server_${SUFFIX_NAME}.deb-bundle.tar -chmod +x ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar -cd ${myDir} && tar vxf ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar - -apt update -y -apt install -y libnuma1 libaio1 libmecab2 - -# 安装 -dpkg -X mysql-common_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - - - -dpkg -X mysql-community-client-plugins_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-community-client-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-community-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - -dpkg -X mysql-community-server-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - -dpkg -X mysql-community-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - -# 测试时可关闭 -rm -rf $myDir -####### -} - -APT_UNINSTALL() -{ -### -rm -rf $myDir -# apt remove -y mysql-server -### -} - - -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.sh b/plugins/mysql-apt/versions/8.2/install.sh deleted file mode 100755 index 81cade8267..0000000000 --- a/plugins/mysql-apt/versions/8.2/install.sh +++ /dev/null @@ -1,137 +0,0 @@ - -# -*- 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 - -bash ${rootPath}/scripts/getos.sh -OSNAME=`cat ${rootPath}/data/osname.pl` -VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` - -# cd /www/server/mdserver-web/plugins/mysql-apt && bash install.sh install 8.0 -# cd /www/server/mdserver-web && source bin/activate && python3 plugins/mysql-apt/index.py start - -# 暂时debian12没有标准版,先用11使用 -# if [ "$OSNAME" == 'debian' ] && [ "$VERSION_ID" == '12' ] ;then -# echo "暂时不支持该${OSNAME}${VERSION_ID}" -# exit 1 -# fi - - -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.2.0 -SUFFIX_NAME=${MYSQL_VER}-1${OSNAME}${VERSION_ID}_${ARCH} - - -# /lib/systemd/system/mysql.service -# /etc/mysql/my.cnf - -APT_INSTALL() -{ -######## -mkdir -p $myDir -mkdir -p $serverPath/mysql-apt/bin - -mkdir -p /var/run/mysqld -chown mysql -R /var/run/mysqld - -wget --no-check-certificate -O ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar https://cdn.mysql.com/archives/mysql-8.2/mysql-server_${SUFFIX_NAME}.deb-bundle.tar -chmod +x ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar -cd ${myDir} && tar vxf ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar - -apt update -y -apt install -y libnuma1 libaio1 libmecab2 - -# 安装 -dpkg -X mysql-common_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - - - -dpkg -X mysql-community-client-plugins_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-community-client-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-community-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - -dpkg -X mysql-community-server-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - -dpkg -X mysql-community-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - -# 测试时可关闭 -rm -rf $myDir -####### -} - -APT_UNINSTALL() -{ -### -rm -rf $myDir -# apt remove -y mysql-server -### -} - - -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.sh b/plugins/mysql-apt/versions/8.3/install.sh deleted file mode 100755 index 316ae77edf..0000000000 --- a/plugins/mysql-apt/versions/8.3/install.sh +++ /dev/null @@ -1,135 +0,0 @@ -# -*- 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 - -bash ${rootPath}/scripts/getos.sh -OSNAME=`cat ${rootPath}/data/osname.pl` -VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` - -# cd /www/server/mdserver-web/plugins/mysql-apt && bash install.sh install 8.0 - -# 暂时debian12没有标准版,先用11使用 -# if [ "$OSNAME" == 'debian' ] && [ "$VERSION_ID" == '12' ] ;then -# echo "暂时不支持该${OSNAME}${VERSION_ID}" -# exit 1 -# fi - - -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.3.0 -SUFFIX_NAME=${MYSQL_VER}-1${OSNAME}${VERSION_ID}_${ARCH} - - -# /lib/systemd/system/mysql.service -# /etc/mysql/my.cnf - -APT_INSTALL() -{ -######## -mkdir -p $myDir -mkdir -p $serverPath/mysql-apt/bin - -mkdir -p /var/run/mysqld -chown mysql -R /var/run/mysqld - -wget --no-check-certificate -O ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar https://cdn.mysql.com/archives/mysql-8.3/mysql-server_${SUFFIX_NAME}.deb-bundle.tar -chmod +x ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar -cd ${myDir} && tar vxf ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar - -apt update -y -apt install -y libnuma1 libaio1 libmecab2 - -# 安装 -dpkg -X mysql-common_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - - - -dpkg -X mysql-community-client-plugins_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-community-client-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-community-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - -dpkg -X mysql-community-server-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - -dpkg -X mysql-community-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - -# 测试时可关闭 -rm -rf $myDir -####### -} - -APT_UNINSTALL() -{ -### -rm -rf $myDir -# apt remove -y mysql-server -### -} - - -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.sh b/plugins/mysql-apt/versions/8.4/install.sh deleted file mode 100755 index dfcd789980..0000000000 --- a/plugins/mysql-apt/versions/8.4/install.sh +++ /dev/null @@ -1,137 +0,0 @@ -# -*- 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 - -bash ${rootPath}/scripts/getos.sh -OSNAME=`cat ${rootPath}/data/osname.pl` -VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` - -# 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 - -if [ "$OSNAME" == 'debian' ] && [ "$VERSION_ID" -lt '12' ] ;then - VERSION_ID="12" -fi - - -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}-1${OSNAME}${VERSION_ID}_${ARCH} - - -# /lib/systemd/system/mysql.service -# /etc/mysql/my.cnf - -APT_INSTALL() -{ -######## -mkdir -p $myDir -mkdir -p $serverPath/mysql-apt/bin - -mkdir -p /var/run/mysqld -chown mysql -R /var/run/mysqld - -# https://cdn.mysql.com/archives/mysql-8.4/mysql-server_${SUFFIX_NAME}.deb-bundle.tar -# https://dev.mysql.com/get/Downloads/MySQL-8.4/mysql-server_${SUFFIX_NAME}.deb-bundle.tar - -wget --no-check-certificate -O ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar https://dev.mysql.com/get/Downloads/MySQL-8.4/mysql-server_${SUFFIX_NAME}.deb-bundle.tar -chmod +x ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar -cd ${myDir} && tar vxf ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar - -apt update -y -apt install -y libnuma1 libaio1 libmecab2 - -# 安装 -dpkg -X mysql-common_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - - - -dpkg -X mysql-community-client-plugins_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-community-client-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-community-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - -dpkg -X mysql-community-server-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - -dpkg -X mysql-community-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - -# 测试时可关闭 -rm -rf $myDir -####### -} - -APT_UNINSTALL() -{ -### -rm -rf $myDir -# apt remove -y mysql-server -### -} - - -Install_mysql() -{ - echo '正在安装脚本文件...' - - isApt=`which apt` - if [ "$isApt" != "" ];then - APT_INSTALL - fi - - if [ "$?" == "0" ];then - mkdir -p $serverPath/mysql-apt - echo '8.4' > $serverPath/mysql-apt/version.pl - echo '安装完成' - else - echo '8.4' > $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 deleted file mode 100755 index e2a2195fdb..0000000000 --- a/plugins/mysql-apt/versions/8.4/install_generic.sh +++ /dev/null @@ -1,141 +0,0 @@ -# -*- 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 - -bash ${rootPath}/scripts/getos.sh -OSNAME=`cat ${rootPath}/data/osname.pl` -VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` - -# 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 - -if [ "$OSNAME" == 'debian' ] && [ "$VERSION_ID" -lt '12' ] ;then - VERSION_ID="12" -fi - - -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}-1${OSNAME}${VERSION_ID}_${ARCH} - - -# /lib/systemd/system/mysql.service -# /etc/mysql/my.cnf - -APT_INSTALL() -{ -######## -mkdir -p $myDir -mkdir -p $serverPath/mysql-apt/bin - -mkdir -p /var/run/mysqld -chown mysql -R /var/run/mysqld - -# Linux - Generic - -# https://cdn.mysql.com/archives/mysql-8.4/mysql-8.4.2-linux-glibc2.28-x86_64.tar.xz - -# SUFFIX_NAME=${MYSQL_VER}-linux-glibc2.28_${TMP_ARCH} -# wget --no-check-certificate -O mysql-8.4.2-linux-glibc2.28-x86_64.tar.xz https://cdn.mysql.com/archives/mysql-8.4/mysql-${SUFFIX_NAME}.tar.xz - -wget --no-check-certificate -O ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar https://dev.mysql.com/get/Downloads/MySQL-8.4/mysql-server_${SUFFIX_NAME}.deb-bundle.tar -chmod +x ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar -cd ${myDir} && tar vxf ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar - -apt update -y -apt install -y libnuma1 libaio1 libmecab2 - -# 安装 -dpkg -X mysql-common_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - - - -dpkg -X mysql-community-client-plugins_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-community-client-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-community-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - -dpkg -X mysql-community-server-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - -dpkg -X mysql-community-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - -# 测试时可关闭 -rm -rf $myDir -####### -} - -APT_UNINSTALL() -{ -### -rm -rf $myDir -# apt remove -y mysql-server -### -} - - -Install_mysql() -{ - echo '正在安装脚本文件...' - - isApt=`which apt` - if [ "$isApt" != "" ];then - APT_INSTALL - fi - - if [ "$?" == "0" ];then - mkdir -p $serverPath/mysql-apt - echo '8.4' > $serverPath/mysql-apt/version.pl - echo '安装完成' - else - echo '8.4' > $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/9.0/install.sh b/plugins/mysql-apt/versions/9.0/install.sh deleted file mode 100755 index 874522d9d4..0000000000 --- a/plugins/mysql-apt/versions/9.0/install.sh +++ /dev/null @@ -1,138 +0,0 @@ -# -*- 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 - -bash ${rootPath}/scripts/getos.sh -OSNAME=`cat ${rootPath}/data/osname.pl` -VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` - -# cd /www/server/mdserver-web/plugins/mysql-apt && bash install.sh install 9.0 - -# 暂时debian12没有标准版,先用11使用 -if [ "$OSNAME" == 'debian' ] && [ "$VERSION_ID" -lt '12' ] ;then - VERSION_ID="12" -fi - - -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}-1${OSNAME}${VERSION_ID}_${ARCH} - - -# /lib/systemd/system/mysql.service -# /etc/mysql/my.cnf - -APT_INSTALL() -{ -######## -mkdir -p $myDir -mkdir -p $serverPath/mysql-apt/bin - -mkdir -p /var/run/mysqld -chown mysql -R /var/run/mysqld - -# https://dev.mysql.com/get/Downloads/MySQL-9.0/mysql-server_${SUFFIX_NAME}.deb-bundle.tar -# https://cdn.mysql.com/archives/mysql-9.0/mysql-server_9.0.1-1debian12_amd64.deb-bundle.tar - -wget --no-check-certificate -O ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar https://cdn.mysql.com/archives/mysql-9.0/mysql-server_${SUFFIX_NAME}.deb-bundle.tar -# wget --no-check-certificate -O ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar https://dev.mysql.com/get/Downloads/MySQL-9.1/mysql-server_${SUFFIX_NAME}.deb-bundle.tar -chmod +x ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar -cd ${myDir} && tar vxf ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar - -apt update -y -apt install -y libnuma1 libaio1 libmecab2 - -# 安装 -dpkg -X mysql-common_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - - - -dpkg -X mysql-community-client-plugins_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-community-client-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-community-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - -dpkg -X mysql-community-server-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - -dpkg -X mysql-community-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - -# 测试时可关闭 -rm -rf $myDir -####### -} - -APT_UNINSTALL() -{ -### -rm -rf $myDir -# apt remove -y mysql-server -### -} - - -Install_mysql() -{ - echo '正在安装脚本文件...' - - isApt=`which apt` - if [ "$isApt" != "" ];then - APT_INSTALL - fi - - if [ "$?" == "0" ];then - mkdir -p $serverPath/mysql-apt - echo '9.0' > $serverPath/mysql-apt/version.pl - echo '安装完成' - else - echo '9.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/9.1/install.sh b/plugins/mysql-apt/versions/9.1/install.sh deleted file mode 100755 index 27d3460981..0000000000 --- a/plugins/mysql-apt/versions/9.1/install.sh +++ /dev/null @@ -1,144 +0,0 @@ -# -*- 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 - -bash ${rootPath}/scripts/getos.sh -OSNAME=`cat ${rootPath}/data/osname.pl` -VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` - -# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-apt/index.py start 9.1 -# cd /www/server/mdserver-web/plugins/mysql-apt && bash install.sh install 9.1 - -#x-faq -# strings /lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIB - -# debian12 -if [ "$OSNAME" == 'debian' ] && [ "$VERSION_ID" -lt '12' ] ;then - VERSION_ID="12" -fi - - -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.1.0 -SUFFIX_NAME=${MYSQL_VER}-1${OSNAME}${VERSION_ID}_${ARCH} - - -# /lib/systemd/system/mysql.service -# /etc/mysql/my.cnf - -APT_INSTALL() -{ - -cd ${rootPath}/plugins/php/lib && /bin/bash openssl_30.sh - -######## -mkdir -p $myDir -mkdir -p $serverPath/mysql-apt/bin - -mkdir -p /var/run/mysqld -chown mysql -R /var/run/mysqld - -# https://cdn.mysql.com/archives/mysql-9.1/mysql-server_${SUFFIX_NAME}.deb-bundle.tar -# https://dev.mysql.com/get/Downloads/MySQL-9.1/mysql-server_${SUFFIX_NAME}.deb-bundle.tar - -wget --no-check-certificate -O ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar https://dev.mysql.com/get/Downloads/MySQL-9.1/mysql-server_${SUFFIX_NAME}.deb-bundle.tar -chmod +x ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar -cd ${myDir} && tar vxf ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar - -apt update -y -apt install -y libnuma1 libaio1 libmecab2 - -# 安装 -dpkg -X mysql-common_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - - - -dpkg -X mysql-community-client-plugins_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-community-client-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-community-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - -dpkg -X mysql-community-server-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - -dpkg -X mysql-community-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin -dpkg -X mysql-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin - -# 测试时可关闭 -rm -rf $myDir -####### -} - -APT_UNINSTALL() -{ -### -rm -rf $myDir -# apt remove -y mysql-server -### -} - - -Install_mysql() -{ - echo '正在安装脚本文件...' - - isApt=`which apt` - if [ "$isApt" != "" ];then - APT_INSTALL - fi - - if [ "$?" == "0" ];then - mkdir -p $serverPath/mysql-apt - echo '9.1' > $serverPath/mysql-apt/version.pl - echo '安装完成' - else - echo '9.1' > $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/conf/classic.cnf b/plugins/mysql-community/conf/classic.cnf similarity index 100% rename from plugins/mysql-apt/conf/classic.cnf rename to plugins/mysql-community/conf/classic.cnf diff --git a/plugins/mysql-apt/conf/gtid.cnf b/plugins/mysql-community/conf/gtid.cnf similarity index 100% rename from plugins/mysql-apt/conf/gtid.cnf rename to plugins/mysql-community/conf/gtid.cnf diff --git a/plugins/mysql-apt/conf/my5.7.cnf b/plugins/mysql-community/conf/my5.7.cnf similarity index 97% rename from plugins/mysql-apt/conf/my5.7.cnf rename to plugins/mysql-community/conf/my5.7.cnf index d04b185ad8..f97a2bfb71 100644 --- a/plugins/mysql-apt/conf/my5.7.cnf +++ b/plugins/mysql-community/conf/my5.7.cnf @@ -18,7 +18,7 @@ server-id = {$SERVER_ID} sql-mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES default_storage_engine = InnoDB -language={$SERVER_APP_PATH}/bin/usr/share/mysql/english +language={$SERVER_APP_PATH}/share/english key_buffer_size = 8M table_open_cache = 32 diff --git a/plugins/mysql-apt/conf/my8.0.cnf b/plugins/mysql-community/conf/my8.0.cnf similarity index 100% rename from plugins/mysql-apt/conf/my8.0.cnf rename to plugins/mysql-community/conf/my8.0.cnf diff --git a/plugins/mysql-apt/conf/my8.2.cnf b/plugins/mysql-community/conf/my8.2.cnf similarity index 100% rename from plugins/mysql-apt/conf/my8.2.cnf rename to plugins/mysql-community/conf/my8.2.cnf diff --git a/plugins/mysql-apt/conf/my8.3.cnf b/plugins/mysql-community/conf/my8.3.cnf similarity index 100% rename from plugins/mysql-apt/conf/my8.3.cnf rename to plugins/mysql-community/conf/my8.3.cnf diff --git a/plugins/mysql-apt/conf/my8.4.cnf b/plugins/mysql-community/conf/my8.4.cnf similarity index 100% rename from plugins/mysql-apt/conf/my8.4.cnf rename to plugins/mysql-community/conf/my8.4.cnf diff --git a/plugins/mysql-apt/conf/my9.0.cnf b/plugins/mysql-community/conf/my9.0.cnf similarity index 100% rename from plugins/mysql-apt/conf/my9.0.cnf rename to plugins/mysql-community/conf/my9.0.cnf diff --git a/plugins/mysql-apt/conf/my9.1.cnf b/plugins/mysql-community/conf/my9.1.cnf similarity index 100% rename from plugins/mysql-apt/conf/my9.1.cnf rename to plugins/mysql-community/conf/my9.1.cnf diff --git a/plugins/mysql-apt/conf/mysql.sql b/plugins/mysql-community/conf/mysql.sql similarity index 100% rename from plugins/mysql-apt/conf/mysql.sql rename to plugins/mysql-community/conf/mysql.sql diff --git a/plugins/mysql-apt/ico.png b/plugins/mysql-community/ico.png similarity index 100% rename from plugins/mysql-apt/ico.png rename to plugins/mysql-community/ico.png diff --git a/plugins/mysql-apt/index.html b/plugins/mysql-community/index.html similarity index 67% rename from plugins/mysql-apt/index.html rename to plugins/mysql-community/index.html index 7732e6dbc2..cb109b0dbb 100755 --- a/plugins/mysql-apt/index.html +++ b/plugins/mysql-community/index.html @@ -3,15 +3,15 @@
服务
-自启动
-配置文件
+服务
+自启动
+配置文件
存储位置
端口
当前状态
性能优化
日志
-慢日志
+慢日志
BINLOG
管理列表
主从配置
@@ -53,7 +53,7 @@ \ No newline at end of file diff --git a/plugins/mysql-apt/index.py b/plugins/mysql-community/index.py similarity index 96% rename from plugins/mysql-apt/index.py rename to plugins/mysql-community/index.py index 4b9f03c7e5..b9283a12d4 100755 --- a/plugins/mysql-apt/index.py +++ b/plugins/mysql-community/index.py @@ -22,7 +22,7 @@ def getPluginName(): - return 'mysql-apt' + return 'mysql-community' def getPluginDir(): @@ -74,7 +74,7 @@ def getArgs(): def getBackupDir(): - bk_path = mw.getBackupDir() + "/database/mysql-apt" + bk_path = mw.getBackupDir() + "/database/mysql-community" if not os.path.isdir(bk_path): mw.execShell("mkdir -p {}".format(bk_path)) return bk_path @@ -137,12 +137,10 @@ def contentReplace(content): service_path = mw.getServerDir() content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) - content = content.replace('{$SERVER_APP_PATH}', - service_path + '/' + getPluginName()) + content = content.replace('{$SERVER_APP_PATH}',service_path + '/' + getPluginName()) server_id = int(time.time()) content = content.replace('{$SERVER_ID}', str(server_id)) - return content @@ -232,7 +230,7 @@ def initDreplace(version=''): # systemd systemDir = mw.systemdCfgDir() - systemService = systemDir + '/mysql-apt.service' + systemService = systemDir + '/mysql-community.service' systemServiceTpl = getPluginDir() + '/init.d/mysql' + version + '.service.tpl' if os.path.exists(systemDir) and not os.path.exists(systemService): service_path = mw.getServerDir() @@ -246,7 +244,7 @@ def initDreplace(version=''): return 'ok' def process_status(): - cmd = "ps -ef|grep mysql-apt|grep mysql |grep -v grep | grep -v python | awk '{print $2}'" + cmd = "ps -ef|grep mysql-community|grep mysql |grep -v grep | grep -v python | awk '{print $2}'" data = mw.execShell(cmd) if data[0] == '': return 'stop' @@ -416,9 +414,11 @@ def initMysql57Data(): myconf = serverdir + "/etc/my.cnf" user = pGetDbUser() - cmd = serverdir + '/bin/usr/sbin/mysqld --basedir=' + serverdir + '/bin/usr --datadir=' + \ + cmd = serverdir + '/bin/mysqld --basedir=' + serverdir + ' --datadir=' + \ datadir + ' --initialize-insecure --explicit_defaults_for_timestamp' + # print(cmd) data = mw.execShell(cmd) + # print(data) if data[1].lower().find('error') != -1: exit("Init MySQL5.7 Data Error:"+data[1]) @@ -431,10 +431,10 @@ def initMysql57Data(): def initMysql8Data(): ''' - chmod 644 /www/server/mysql-apt/etc/my.cnf + chmod 644 /www/server/mysql-community/etc/my.cnf try: - mysqld --basedir=/usr --datadir=/www/server/mysql-apt/data --initialize-insecure - mysqld --defaults-file=/www/server/mysql-apt/etc/my.cnf --initialize-insecure + mysqld --basedir=/usr --datadir=/www/server/mysql-community/data --initialize-insecure + mysqld --defaults-file=/www/server/mysql-community/etc/my.cnf --initialize-insecure mysqld --initialize-insecure select user, plugin from user; update user set authentication_string=password("123123"),plugin='mysql_native_password' where user='root'; @@ -444,9 +444,11 @@ def initMysql8Data(): serverdir = getServerDir() user = pGetDbUser() - cmd = serverdir + '/bin/usr/sbin/mysqld --basedir=' + serverdir + '/bin/usr --datadir=' + datadir + \ + cmd = serverdir + '/bin/mysqld --basedir=' + serverdir + ' --datadir=' + datadir + \ ' --initialize-insecure --lower-case-table-names=1' + # print(cmd) data = mw.execShell(cmd) + # print(data) if data[1].lower().find('error') != -1: exit("Init MySQL8+ Data Error:"+data[1]) if data[1].lower().find('not found') != -1: @@ -470,7 +472,7 @@ def initMysql8Pwd(): myconf = serverdir + "/etc/my.cnf" pwd = mw.getRandomString(16) - cmd_my = serverdir + '/bin/usr/bin/mysql' + cmd_my = serverdir + '/bin/mysql' cmd_pass = cmd_my + ' --defaults-file=' + myconf + ' -uroot -e' cmd_pass = cmd_pass + '"alter user \'root\'@\'localhost\' identified by \'' + pwd + '\';' @@ -494,12 +496,10 @@ def initMysql8Pwd(): # 删除冗余账户 hostname = mw.execShell('hostname')[0].strip() if hostname != 'localhost': - drop_hostname = cmd_my + ' --defaults-file=' + \ - myconf + ' -uroot -p' + pwd + ' -e "drop user \'\'@\'' + hostname + '\'";' + drop_hostname = cmd_my + ' --defaults-file=' + myconf + ' -uroot -p' + pwd + ' -e "drop user \'\'@\'' + hostname + '\'";' mw.execShell(drop_hostname) - drop_root_hostname = cmd_my + ' --defaults-file=' + \ - myconf + ' -uroot -p' + pwd + ' -e "drop user \'root\'@\'' + hostname + '\'";' + drop_root_hostname = cmd_my + ' --defaults-file=' + myconf + ' -uroot -p' + pwd + ' -e "drop user \'root\'@\'' + hostname + '\'";' mw.execShell(drop_root_hostname) return True @@ -639,8 +639,7 @@ def setMyDbPos(version=''): mw.writeFile(myfile, mycnf) restart(version) - result = mw.execShell( - 'ps aux|grep mysqld| grep -v grep|grep -v python') + result = mw.execShell('ps aux|grep mysqld| grep -v grep|grep -v python') if len(result[0]) > 10: mw.writeFile('data/datadir.pl', t_datadir) return mw.returnJson(True, '存储目录迁移成功!') @@ -898,7 +897,7 @@ def importDbExternal(): sock = getSocketFile() os.environ["MYSQL_PWD"] = pwd - mysql_cmd = getServerDir() + '/bin/usr/bin/mysql -S ' + sock + ' -uroot -p' + \ + mysql_cmd = getServerDir() + '/bin/mysql -S ' + sock + ' -uroot -p' + \ pwd + ' ' + name + ' < ' + import_sql # print(mysql_cmd) @@ -921,7 +920,7 @@ def importDbExternalProgress(): name = args['name'] cmd = 'cd '+mw.getServerDir()+'/mdserver-web && source bin/activate && ' - cmd += 'python3 '+mw.getServerDir()+'/mdserver-web/plugins/mysql-apt/index.py import_db_external_progress_bar {"file":"'+file+'","name":"'+name+'"}' + cmd += 'python3 '+mw.getServerDir()+'/mdserver-web/plugins/mysql-community/index.py import_db_external_progress_bar {"file":"'+file+'","name":"'+name+'"}' return mw.returnJson(True, 'ok',cmd) def importDbExternalProgressBar(): @@ -984,8 +983,7 @@ def importDbExternalProgressBar(): # option = ' --set-gtid-purged=off ' my_cnf = getConf() - mysql_cmd = getServerDir() + '/bin/usr/bin/mysql --defaults-file=' + my_cnf + \ - ' -uroot -p"' + pwd + '" -f ' + name + mysql_cmd = getServerDir() + '/bin/mysql --defaults-file=' + my_cnf + ' -uroot -p"' + pwd + '" -f ' + name mysql_cmd_progress_bar = "pv -t -p " + import_sql + '|'+ mysql_cmd print(mysql_cmd_progress_bar) rdata = os.system(mysql_cmd_progress_bar) @@ -1009,7 +1007,7 @@ def importDbBackup(): pwd = pSqliteDb('config').where('id=?', (1,)).getField('mysql_root') sock = getSocketFile() - mysql_cmd = getServerDir() + '/bin/usr/bin/mysql -S ' + sock + ' -uroot -p' + pwd + \ + mysql_cmd = getServerDir() + '/bin/mysql -S ' + sock + ' -uroot -p' + pwd + \ ' ' + name + ' < ' + file_path_sql # print(mysql_cmd) @@ -1514,7 +1512,7 @@ def resetDbRootPwd(version): pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,)) mdb8 = getMdb8Ver() if not mw.inArray(mdb8, version): - cmd_pass = serverdir + '/bin/usr/bin/mysql --defaults-file=' + myconf + ' -uroot -e' + cmd_pass = serverdir + '/bin/mysql --defaults-file=' + myconf + ' -uroot -e' cmd_pass = cmd_pass + '"UPDATE mysql.user SET password=PASSWORD(\'' + pwd + "') WHERE user='root';" cmd_pass = cmd_pass + 'flush privileges;"' data = mw.execShell(cmd_pass) @@ -1534,7 +1532,7 @@ def resetDbRootPwd(version): tmp_file = "/tmp/mysql_init_tmp.log" mw.writeFile(tmp_file, reset_pwd) - cmd_pass = serverdir + '/bin/usr/bin/mysql --defaults-file=' + myconf + ' -uroot -proot < ' + tmp_file + cmd_pass = serverdir + '/bin/mysql --defaults-file=' + myconf + ' -uroot -proot < ' + tmp_file data = mw.execShell(cmd_pass) # print(data) @@ -2843,7 +2841,7 @@ def syncDatabaseRepairLog(version=''): sync_args_sign = args['sign'] op = args['op'] tmp_log = syncDatabaseRepairTempFile() - cmd = 'cd '+mw.getServerDir()+'/mdserver-web && source bin/activate && python3 plugins/mysql-apt/index.py sync_database_repair {"db":"'+sync_args_db+'","sign":"'+sync_args_sign+'"}' + cmd = 'cd '+mw.getServerDir()+'/mdserver-web && source bin/activate && python3 plugins/mysql-community/index.py sync_database_repair {"db":"'+sync_args_db+'","sign":"'+sync_args_sign+'"}' # print(cmd) if op == 'get': @@ -3093,7 +3091,7 @@ def syncDatabaseRepair(version=''): ############### --- 重要 同步---- ########### def asyncTmpfile(): - path = '/tmp/mysql_apt_async_status.txt' + path = '/tmp/mysql_community_async_status.txt' return path @@ -3111,7 +3109,7 @@ def fullSyncCmd(): db = args['db'] sign = args['sign'] - cmd = 'cd '+mw.getServerDir()+'/mdserver-web && source bin/activate && python3 plugins/mysql-apt/index.py do_full_sync {"db":"'+db+'","sign":"'+sign+'"}' + cmd = 'cd '+mw.getServerDir()+'/mdserver-web && source bin/activate && python3 plugins/mysql-community/index.py do_full_sync {"db":"'+db+'","sign":"'+sign+'"}' return mw.returnJson(True,'ok',cmd) def doFullSync(version=''): @@ -3245,7 +3243,7 @@ def doFullSyncUser(version=''): dmp_option += " --master-data=1 --apply-slave-statements --include-master-host-port --compress " - dump_sql_data = getServerDir() + "/bin/usr/bin/mysqldump --single-transaction --default-character-set=utf8mb4 -q " + dmp_option + " -h" + \ + dump_sql_data = getServerDir() + "/bin/mysqldump --single-transaction --default-character-set=utf8mb4 -q " + dmp_option + " -h" + \ ip + " -P" + port + " -u" + user + ' -p"' + apass + '" --ssl-mode=DISABLED ' + sync_db + " > " + bak_file print(dump_sql_data) time_s = time.time() @@ -3276,16 +3274,16 @@ def doFullSyncUser(version=''): sock = getSocketFile() if is_exist_pv: - my_import_cmd = getServerDir() + '/bin/usr/bin/mysql -S ' + sock + " -uroot -p'" + pwd + "' " + sync_db_import + my_import_cmd = getServerDir() + '/bin/mysql -S ' + sock + " -uroot -p'" + pwd + "' " + sync_db_import my_import_cmd = "pv -t -p " + bak_file + '|' + my_import_cmd print(my_import_cmd) os.system(my_import_cmd) else: - my_import_cmd = getServerDir() + '/bin/usr/bin/mysql -S ' + sock + " -uroot -p'" + pwd + "' " + sync_db_import + ' < ' + bak_file + my_import_cmd = getServerDir() + '/bin/mysql -S ' + sock + " -uroot -p'" + pwd + "' " + sync_db_import + ' < ' + bak_file print(my_import_cmd) mw.execShell(my_import_cmd) - my_import_cmd = getServerDir() + '/bin/usr/bin/mysql -S ' + sock + ' -uroot -p' + pwd + \ + my_import_cmd = getServerDir() + '/bin/mysql -S ' + sock + ' -uroot -p' + pwd + \ ' ' + sync_db_import + ' < ' + bak_file mw.execShell(my_import_cmd) @@ -3420,7 +3418,7 @@ def doFullSyncSSH(version=''): root_dir = getServerDir() msock = root_dir + "/mysql.sock" mw.execShell("cd /tmp && gzip -d dump.sql.gz") - cmd = root_dir + "/bin/usr/bin/mysql -S " + msock + \ + cmd = root_dir + "/bin/mysql -S " + msock + \ " -uroot -p" + pwd + " < /tmp/dump.sql" print(cmd) @@ -3476,43 +3474,6 @@ def fullSync(version=''): def installPreInspection(version): - arch_data = mw.execShell('arch') - if arch_data[0].strip().startswith('aarch'): - return '不支持aarch架构' - - cmd = "cat /etc/*-release | grep PRETTY_NAME |awk -F = '{print $2}' | awk -F '\"' '{print $2}'| awk '{print $1}'" - sys = mw.execShell(cmd) - - if sys[1] != '': - return '不支持改系统' - - cmd = "cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F '\"' '{print $2}'" - sys_id = mw.execShell(cmd) - - sysName = sys[0].strip().lower() - sysId = sys_id[0].strip() - mdb8 = getMdb8Ver() - - if not sysName in ('debian', 'ubuntu'): - return '仅支持debian,ubuntu' - - if (sysName == 'debian' and not sysId in('12', '11', '10')): - return 'debian支持10,11,12' - - if sysName == 'debian' and sysId == '12' and version == '8.0': - return 'debian12,暂时不支持8.0' - - if version == '9.0': - if sysName == 'debian' and sysId != '12': - return '9.0 仅支持debian12' - if sysName == 'ubuntu' and sysId != '24.04': - return '9.0 仅支持ubuntu24.04' - - if (sysName == 'ubuntu' and version == '5.7' and not sysId in ('18.04')): - return "Ubuntu Apt MySQL[" + version + "] 仅支持18.04" - - if (sysName == 'ubuntu' and version == '8.0' and not sysId in ('18.04', '20.04', '22.04','24.04')): - return 'Ubuntu Apt MySQL[' + version + '] 仅支持18.04,20.04,22.04,24.04' return 'ok' diff --git a/plugins/mysql-yum/index_mysql_yum.py b/plugins/mysql-community/index_mysql_community.py similarity index 89% rename from plugins/mysql-yum/index_mysql_yum.py rename to plugins/mysql-community/index_mysql_community.py index 6c10d29f0f..0c32680705 100644 --- a/plugins/mysql-yum/index_mysql_yum.py +++ b/plugins/mysql-community/index_mysql_community.py @@ -15,13 +15,20 @@ import core.mw as mw +# if mw.isAppleSystem(): +# cmd = 'ls /usr/local/lib/ | grep python | cut -d \\ -f 1 | awk \'END {print}\'' +# info = mw.execShell(cmd) +# p = "/usr/local/lib/" + info[0].strip() + "/site-packages" +# sys.path.append(p) + + app_debug = False if mw.isAppleSystem(): app_debug = True def getPluginName(): - return 'mysql-yum' + return 'mysql-community' def getPluginDir(): @@ -71,7 +78,7 @@ def binLogListLook(args): line = args['line'] data_dir = getDataDir() - my_bin = getServerDir() + '/bin/usr/bin' + my_bin = getServerDir() + '/bin' my_binlog_cmd = my_bin + '/mysqlbinlog' cmd = my_binlog_cmd + ' --no-defaults ' + \ @@ -92,7 +99,7 @@ def binLogListLookDecode(args): line = args['line'] data_dir = getDataDir() - my_bin = getServerDir() + '/bin/usr/bin' + my_bin = getServerDir() + '/bin' my_binlog_cmd = my_bin + '/mysqlbinlog' cmd = my_binlog_cmd + ' --no-defaults --base64-output=decode-rows -vvvv ' + \ @@ -130,7 +137,7 @@ def binLogListTraceRelay(args): file = relay_list[0] - my_bin = getServerDir() + '/bin/usr/bin' + my_bin = getServerDir() + '/bin' my_binlog_cmd = my_bin + '/mysqlbinlog' cmd = my_binlog_cmd + ' --no-defaults --base64-output=decode-rows -vvvv ' + \ @@ -168,7 +175,7 @@ def binLogListTraceBinLog(args): log_bin_l = sorted(log_bin_l, reverse=True) file = log_bin_l[0] - my_bin = getServerDir() + '/bin/usr/bin' + my_bin = getServerDir() + '/bin' my_binlog_cmd = my_bin + '/mysqlbinlog' cmd = my_binlog_cmd + ' --no-defaults --base64-output=decode-rows -vvvv ' + \ diff --git a/plugins/mysql-apt/info.json b/plugins/mysql-community/info.json similarity index 66% rename from plugins/mysql-apt/info.json rename to plugins/mysql-community/info.json index ea19db4d49..eb8c9c367e 100755 --- a/plugins/mysql-apt/info.json +++ b/plugins/mysql-community/info.json @@ -1,17 +1,17 @@ { "hook":["database"], - "title":"MySQL[APT]", + "title":"MySQL[Tar]", "tip":"soft", - "name":"mysql-apt", + "name":"mysql-community", "type":"运行环境", - "ps":"一种关系数据库管理系统[debian,ubuntu](极速安装)", + "ps":"一种关系数据库管理系统(极速安装)", "todo_versions":["5.7","8.0"], "versions":["5.7","8.0","8.2","8.3","8.4","9.0","9.1"], "shell":"install.sh", "install_pre_inspection":true, "uninstall_pre_inspection":true, - "checks":"server/mysql-apt", - "path":"server/mysql-apt", + "checks":"server/mysql-community", + "path":"server/mysql-community", "author":"mysql", "home":"https://dev.mysql.com/downloads/mysql", "date":"2022-06-29", diff --git a/plugins/mysql-apt/init.d/mysql5.7.service.tpl b/plugins/mysql-community/init.d/mysql5.7.service.tpl similarity index 88% rename from plugins/mysql-apt/init.d/mysql5.7.service.tpl rename to plugins/mysql-community/init.d/mysql5.7.service.tpl index e9c46ad414..dad046923f 100644 --- a/plugins/mysql-apt/init.d/mysql5.7.service.tpl +++ b/plugins/mysql-community/init.d/mysql5.7.service.tpl @@ -31,8 +31,7 @@ User=mysql Group=mysql Type=simple PermissionsStartOnly=true -#ExecStartPre={$SERVER_PATH}/mysql-apt/bin/usr/share/mysql/mysql-systemd-start pre -ExecStart={$SERVER_PATH}/mysql-apt/bin/usr/sbin/mysqld --defaults-file={$SERVER_PATH}/mysql-apt/etc/my.cnf +ExecStart={$SERVER_PATH}/mysql-community/bin/mysqld --defaults-file={$SERVER_PATH}/mysql-community/etc/my.cnf TimeoutSec=600 LimitNOFILE = 5000 Restart=on-failure diff --git a/plugins/mysql-apt/init.d/mysql8.0.service.tpl b/plugins/mysql-community/init.d/mysql8.0.service.tpl similarity index 94% rename from plugins/mysql-apt/init.d/mysql8.0.service.tpl rename to plugins/mysql-community/init.d/mysql8.0.service.tpl index 8dacece560..0672790163 100644 --- a/plugins/mysql-apt/init.d/mysql8.0.service.tpl +++ b/plugins/mysql-community/init.d/mysql8.0.service.tpl @@ -36,7 +36,7 @@ User=mysql Group=mysql Type=notify #ExecStartPre=+/usr/share/mysql-8.0/mysql-systemd-start pre -ExecStart={$SERVER_PATH}/mysql-apt/bin/usr/sbin/mysqld --defaults-file={$SERVER_PATH}/mysql-apt/etc/my.cnf +ExecStart={$SERVER_PATH}/mysql-community/bin/mysqld --defaults-file={$SERVER_PATH}/mysql-community/etc/my.cnf TimeoutSec=600 LimitNOFILE = 10000 Restart=on-failure diff --git a/plugins/mysql-apt/init.d/mysql8.1.service.tpl b/plugins/mysql-community/init.d/mysql8.1.service.tpl similarity index 94% rename from plugins/mysql-apt/init.d/mysql8.1.service.tpl rename to plugins/mysql-community/init.d/mysql8.1.service.tpl index 8dacece560..0672790163 100644 --- a/plugins/mysql-apt/init.d/mysql8.1.service.tpl +++ b/plugins/mysql-community/init.d/mysql8.1.service.tpl @@ -36,7 +36,7 @@ User=mysql Group=mysql Type=notify #ExecStartPre=+/usr/share/mysql-8.0/mysql-systemd-start pre -ExecStart={$SERVER_PATH}/mysql-apt/bin/usr/sbin/mysqld --defaults-file={$SERVER_PATH}/mysql-apt/etc/my.cnf +ExecStart={$SERVER_PATH}/mysql-community/bin/mysqld --defaults-file={$SERVER_PATH}/mysql-community/etc/my.cnf TimeoutSec=600 LimitNOFILE = 10000 Restart=on-failure diff --git a/plugins/mysql-apt/init.d/mysql8.2.service.tpl b/plugins/mysql-community/init.d/mysql8.2.service.tpl similarity index 94% rename from plugins/mysql-apt/init.d/mysql8.2.service.tpl rename to plugins/mysql-community/init.d/mysql8.2.service.tpl index 8dacece560..0672790163 100644 --- a/plugins/mysql-apt/init.d/mysql8.2.service.tpl +++ b/plugins/mysql-community/init.d/mysql8.2.service.tpl @@ -36,7 +36,7 @@ User=mysql Group=mysql Type=notify #ExecStartPre=+/usr/share/mysql-8.0/mysql-systemd-start pre -ExecStart={$SERVER_PATH}/mysql-apt/bin/usr/sbin/mysqld --defaults-file={$SERVER_PATH}/mysql-apt/etc/my.cnf +ExecStart={$SERVER_PATH}/mysql-community/bin/mysqld --defaults-file={$SERVER_PATH}/mysql-community/etc/my.cnf TimeoutSec=600 LimitNOFILE = 10000 Restart=on-failure diff --git a/plugins/mysql-apt/init.d/mysql8.3.service.tpl b/plugins/mysql-community/init.d/mysql8.3.service.tpl similarity index 94% rename from plugins/mysql-apt/init.d/mysql8.3.service.tpl rename to plugins/mysql-community/init.d/mysql8.3.service.tpl index 8dacece560..0672790163 100644 --- a/plugins/mysql-apt/init.d/mysql8.3.service.tpl +++ b/plugins/mysql-community/init.d/mysql8.3.service.tpl @@ -36,7 +36,7 @@ User=mysql Group=mysql Type=notify #ExecStartPre=+/usr/share/mysql-8.0/mysql-systemd-start pre -ExecStart={$SERVER_PATH}/mysql-apt/bin/usr/sbin/mysqld --defaults-file={$SERVER_PATH}/mysql-apt/etc/my.cnf +ExecStart={$SERVER_PATH}/mysql-community/bin/mysqld --defaults-file={$SERVER_PATH}/mysql-community/etc/my.cnf TimeoutSec=600 LimitNOFILE = 10000 Restart=on-failure diff --git a/plugins/mysql-apt/init.d/mysql8.4.service.tpl b/plugins/mysql-community/init.d/mysql8.4.service.tpl similarity index 94% rename from plugins/mysql-apt/init.d/mysql8.4.service.tpl rename to plugins/mysql-community/init.d/mysql8.4.service.tpl index a0a8924936..9de86ce288 100644 --- a/plugins/mysql-apt/init.d/mysql8.4.service.tpl +++ b/plugins/mysql-community/init.d/mysql8.4.service.tpl @@ -35,7 +35,7 @@ WantedBy=multi-user.target User=mysql Group=mysql Type=notify -ExecStart={$SERVER_PATH}/mysql-apt/bin/usr/sbin/mysqld --defaults-file={$SERVER_PATH}/mysql-apt/etc/my.cnf +ExecStart={$SERVER_PATH}/mysql-community/bin/mysqld --defaults-file={$SERVER_PATH}/mysql-community/etc/my.cnf TimeoutSec=600 LimitNOFILE = 10000 Restart=on-failure diff --git a/plugins/mysql-apt/init.d/mysql9.0.service.tpl b/plugins/mysql-community/init.d/mysql9.0.service.tpl similarity index 94% rename from plugins/mysql-apt/init.d/mysql9.0.service.tpl rename to plugins/mysql-community/init.d/mysql9.0.service.tpl index a0a8924936..9de86ce288 100644 --- a/plugins/mysql-apt/init.d/mysql9.0.service.tpl +++ b/plugins/mysql-community/init.d/mysql9.0.service.tpl @@ -35,7 +35,7 @@ WantedBy=multi-user.target User=mysql Group=mysql Type=notify -ExecStart={$SERVER_PATH}/mysql-apt/bin/usr/sbin/mysqld --defaults-file={$SERVER_PATH}/mysql-apt/etc/my.cnf +ExecStart={$SERVER_PATH}/mysql-community/bin/mysqld --defaults-file={$SERVER_PATH}/mysql-community/etc/my.cnf TimeoutSec=600 LimitNOFILE = 10000 Restart=on-failure diff --git a/plugins/mysql-apt/init.d/mysql9.1.service.tpl b/plugins/mysql-community/init.d/mysql9.1.service.tpl similarity index 94% rename from plugins/mysql-apt/init.d/mysql9.1.service.tpl rename to plugins/mysql-community/init.d/mysql9.1.service.tpl index a0a8924936..9de86ce288 100644 --- a/plugins/mysql-apt/init.d/mysql9.1.service.tpl +++ b/plugins/mysql-community/init.d/mysql9.1.service.tpl @@ -35,7 +35,7 @@ WantedBy=multi-user.target User=mysql Group=mysql Type=notify -ExecStart={$SERVER_PATH}/mysql-apt/bin/usr/sbin/mysqld --defaults-file={$SERVER_PATH}/mysql-apt/etc/my.cnf +ExecStart={$SERVER_PATH}/mysql-community/bin/mysqld --defaults-file={$SERVER_PATH}/mysql-community/etc/my.cnf TimeoutSec=600 LimitNOFILE = 10000 Restart=on-failure diff --git a/plugins/mysql-community/install.sh b/plugins/mysql-community/install.sh new file mode 100755 index 0000000000..16c9ad7d0c --- /dev/null +++ b/plugins/mysql-community/install.sh @@ -0,0 +1,71 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") + +# https://dev.mysql.com/downloads/mysql/ +# https://downloads.mysql.com/archives/community/ + + +# /www/server/mysql-community/bin/mysqld --basedir=/www/server/mysql-community --datadir=/www/server/mysql-community/data --initialize-insecure --explicit_defaults_for_timestamp + + +# cd /www/server/mdserver-web/plugins/mysql-community && bash install.sh install 8.0 +# cd /www/server/mdserver-web/plugins/mysql-community && bash install.sh uninstall 8.0 +# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-community/index.py start 5.7 +# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-community/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 + +if id mysql &> /dev/null ;then + echo "mysql UID is `id -u mysql`" + echo "mysql Shell is `grep "^mysql:" /etc/passwd |cut -d':' -f7 `" +else + groupadd mysql + useradd -g mysql -s /usr/sbin/nologin mysql +fi + + +if [ "${2}" == "" ];then + echo '缺少安装脚本...' + exit 0 +fi + +if [ ! -d $curPath/versions/$2 ];then + echo '缺少安装脚本2...' + exit 0 +fi + +if [ "${action}" == "uninstall" ];then + + cd ${rootPath} && python3 ${rootPath}/plugins/mysql-community/index.py stop ${type} + cd ${rootPath} && python3 ${rootPath}/plugins/mysql-community/index.py initd_uninstall ${type} + cd $curPath + + if [ -f /usr/lib/systemd/system/mysql-community.service ] || [ -f /lib/systemd/system/mysql-community.service ];then + systemctl stop mysql-community + systemctl disable mysql-community + rm -rf /usr/lib/systemd/system/mysql-community.service + rm -rf /lib/systemd/system/mysql-community.service + systemctl daemon-reload + fi +fi + + +sh -x $curPath/versions/$2/install_generic.sh $1 + +if [ "${action}" == "install" ];then + #初始化 + + if [ "$?" != "0" ];then + exit $? + fi + cd ${rootPath} && python3 ${rootPath}/plugins/mysql-community/index.py start ${type} + cd ${rootPath} && python3 ${rootPath}/plugins/mysql-community/index.py initd_install ${type} +fi diff --git a/plugins/mysql-apt/js/mysql-apt.js b/plugins/mysql-community/js/mysql-community.js similarity index 99% rename from plugins/mysql-apt/js/mysql-apt.js rename to plugins/mysql-community/js/mysql-community.js index e583af795b..3d1fb3169c 100755 --- a/plugins/mysql-apt/js/mysql-apt.js +++ b/plugins/mysql-community/js/mysql-community.js @@ -14,7 +14,7 @@ function myPost(method,args,callback, title){ } var loadT = layer.msg(_title, { icon: 16, time: 0, shade: 0.3 }); - $.post('/plugins/run', {name:'mysql-apt', func:method, args:_args}, function(data) { + $.post('/plugins/run', {name:'mysql-community', func:method, args:_args}, function(data) { layer.close(loadT); if (!data.status){ layer.msg(data.msg,{icon:0,time:2000,shade: [0.3, '#000']}); @@ -40,7 +40,7 @@ function myPostN(method,args,callback, title){ if (typeof(title) != 'undefined'){ _title = title; } - $.post('/plugins/run', {name:'mysql-apt', func:method, args:_args}, function(data) { + $.post('/plugins/run', {name:'mysql-community', func:method, args:_args}, function(data) { if(typeof(callback) == 'function'){ callback(data); } @@ -56,7 +56,7 @@ function myAsyncPost(method,args){ } var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 }); - return syncPost('/plugins/run', {name:'mysql-apt', func:method, args:_args}); + return syncPost('/plugins/run', {name:'mysql-community', func:method, args:_args}); } @@ -64,9 +64,9 @@ function myPostCallbak(method, version, args,callback){ var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 }); var req_data = {}; - req_data['name'] = 'mysql-apt'; + req_data['name'] = 'mysql-community'; req_data['func'] = method; - req_data['script']='index_mysql_apt'; + req_data['script']='index_mysql_community'; args['version'] = version; @@ -92,9 +92,9 @@ function myPostCallbak(method, version, args,callback){ function myPostCallbakN(method, version, args,callback){ var req_data = {}; - req_data['name'] = 'mysql-apt'; + req_data['name'] = 'mysql-community'; req_data['func'] = method; - req_data['script']='index_mysql_apt'; + req_data['script']='index_mysql_community'; args['version'] = version; diff --git a/plugins/mysql-apt/scripts/backup.py b/plugins/mysql-community/scripts/backup.py similarity index 91% rename from plugins/mysql-apt/scripts/backup.py rename to plugins/mysql-community/scripts/backup.py index a058e5d235..a8073aa00f 100755 --- a/plugins/mysql-apt/scripts/backup.py +++ b/plugins/mysql-community/scripts/backup.py @@ -21,14 +21,12 @@ ''' DEBUG: -python3 /www/server/mdserver-web/plugins/mysql-apt/scripts/backup.py database admin 3 +python3 /www/server/mdserver-web/plugins/mysql-community/scripts/backup.py database admin 3 ''' - - class backupTools: def backupDatabase(self, name, count): - db_path = mw.getServerDir() + '/mysql-apt' + db_path = mw.getServerDir() + '/mysql-community' db_name = 'mysql' find_name = mw.M('databases').dbPos(db_path, 'mysql').where( 'name=?', (name,)).getField('name') @@ -41,7 +39,7 @@ def backupDatabase(self, name, count): "----------------------------------------------------------------------------") return - backup_path = mw.getFatherDir() + '/backup/database/mysql-apt' + backup_path = mw.getFatherDir() + '/backup/database/mysql-community' if not os.path.exists(backup_path): mw.execShell("mkdir -p " + backup_path) @@ -60,8 +58,7 @@ def backupDatabase(self, name, count): if len(mycnf) > 100: mw.writeFile(db_path + '/etc/my.cnf', mycnf) - cmd = db_path + "/bin/usr/bin/mysqldump --defaults-file=" + my_conf_path + " --single-transaction -q --default-character-set=utf8mb4 " + \ - name + " | gzip > " + filename + cmd = db_path + "/bin/usr/bin/mysqldump --defaults-file=" + my_conf_path + " --single-transaction -q --default-character-set=utf8mb4 " + name + " | gzip > " + filename mw.execShell(cmd) if not os.path.exists(filename): @@ -102,7 +99,7 @@ def backupDatabase(self, name, count): break def backupDatabaseAll(self, save): - db_path = mw.getServerDir() + '/mysql-apt' + db_path = mw.getServerDir() + '/mysql-community' db_name = 'mysql' databases = mw.M('databases').dbPos(db_path, db_name).field('name').select() for database in databases: diff --git a/plugins/mysql-community/versions/5.7/install_generic.sh b/plugins/mysql-community/versions/5.7/install_generic.sh new file mode 100755 index 0000000000..9cb55ed5c5 --- /dev/null +++ b/plugins/mysql-community/versions/5.7/install_generic.sh @@ -0,0 +1,87 @@ +# -*- 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-community + +OS_ARCH=`arch` +MYSQL_VER=5.7.44 +SUFFIX_NAME=${MYSQL_VER}-linux-glibc2.12-${OS_ARCH} + +if [ "$OS_ARCH" == "x86_64" ] || [ "$OS_ARCH" == "i686" ];then + echo "ok" +else + echo "暂时不支持该${OS_ARCH}" + exit 0 +fi + +# cd /www/server/mdserver-web/plugins/mysql-community && bash install.sh install 5.7 +# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-community/index.py start 5.7 +COMMUNITY_INSTALL() +{ + +######## +mkdir -p $myDir +mkdir -p $serverPath/mysql-community + +# Linux - Generic +if [ ! -f ${myDir}/mysql-${SUFFIX_NAME}.tar.gz ];then + wget --no-check-certificate -O ${myDir}/mysql-${SUFFIX_NAME}.tar.gz https://cdn.mysql.com/archives/mysql-5.7/mysql-${SUFFIX_NAME}.tar.gz +fi + +if [ -d ${myDir} ];then + cd ${myDir} && tar -zvxf ${myDir}/mysql-${SUFFIX_NAME}.tar.gz + cp -rf ${myDir}/mysql-${SUFFIX_NAME}/* $serverPath/mysql-community +fi + +# 测试时可关闭 +rm -rf $myDir/mysql-${SUFFIX_NAME} +####### +} + +COMMUNITY_UNINSTALL() +{ +### +rm -rf $myDir/mysql-${SUFFIX_NAME} +### +} + + +Install_mysql() +{ + echo '正在安装脚本文件...' + COMMUNITY_INSTALL + if [ "$?" == "0" ];then + mkdir -p $serverPath/mysql-community + echo '5.7' > $serverPath/mysql-community/version.pl + echo '安装完成' + else + echo '5.7' > $serverPath/mysql-community/version.pl + echo "暂时不支持该系统" + fi +} + +Uninstall_mysql() +{ + COMMUNITY_UNINSTALL + rm -rf $serverPath/mysql-community + echo '卸载完成' +} + +action=$1 +if [ "${1}" == 'install' ];then + Install_mysql +else + Uninstall_mysql +fi diff --git a/plugins/mysql-community/versions/8.0/install_generic.sh b/plugins/mysql-community/versions/8.0/install_generic.sh new file mode 100755 index 0000000000..f0debfa91b --- /dev/null +++ b/plugins/mysql-community/versions/8.0/install_generic.sh @@ -0,0 +1,83 @@ +# -*- 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-community + +OS_ARCH=`arch` +MYSQL_VER=8.0.39 +SUFFIX_NAME=${MYSQL_VER}-linux-glibc2.28-${OS_ARCH} + +# cd /www/server/mdserver-web/plugins/mysql-community && bash install.sh install 8.0 +# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-community/index.py start 8.0 +COMMUNITY_INSTALL() +{ + +######## +mkdir -p $myDir +mkdir -p $serverPath/mysql-community + +# 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-community +fi + +# 测试时可关闭 +rm -rf $myDir/mysql-${SUFFIX_NAME} +####### +} + +COMMUNITY_UNINSTALL() +{ +### +rm -rf $myDir/mysql-${SUFFIX_NAME} +### +} + + +Install_mysql() +{ + echo '正在安装脚本文件...' + + COMMUNITY_INSTALL + + if [ "$?" == "0" ];then + mkdir -p $serverPath/mysql-community + echo '8.0' > $serverPath/mysql-community/version.pl + echo '安装完成' + else + echo '8.0' > $serverPath/mysql-community/version.pl + echo "暂时不支持该系统" + fi +} + +Uninstall_mysql() +{ + COMMUNITY_UNINSTALL + + rm -rf $serverPath/mysql-community + echo '卸载完成' +} + +action=$1 +if [ "${1}" == 'install' ];then + Install_mysql +else + Uninstall_mysql +fi diff --git a/plugins/mysql-community/versions/8.2/install_generic.sh b/plugins/mysql-community/versions/8.2/install_generic.sh new file mode 100755 index 0000000000..d2cb381d3a --- /dev/null +++ b/plugins/mysql-community/versions/8.2/install_generic.sh @@ -0,0 +1,81 @@ +# -*- 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-community + +OS_ARCH=`arch` +MYSQL_VER=8.2.0 +SUFFIX_NAME=${MYSQL_VER}-linux-glibc2.28-${OS_ARCH} + +# cd /www/server/mdserver-web/plugins/mysql-community && bash install.sh install 8.2 +# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-community/index.py start 8.2 +COMMUNITY_INSTALL() +{ + +######## +mkdir -p $myDir +mkdir -p $serverPath/mysql-community + +# 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-community +fi + +# 测试时可关闭 +rm -rf $myDir/mysql-${SUFFIX_NAME} +####### +} + +COMMUNITY_UNINSTALL() +{ +### +rm -rf $myDir/mysql-${SUFFIX_NAME} +### +} + + +Install_mysql() +{ + echo '正在安装脚本文件...' + COMMUNITY_INSTALL + + if [ "$?" == "0" ];then + mkdir -p $serverPath/mysql-community + echo '8.2' > $serverPath/mysql-community/version.pl + echo '安装完成' + else + echo '8.2' > $serverPath/mysql-community/version.pl + echo "暂时不支持该系统" + fi +} + +Uninstall_mysql() +{ + COMMUNITY_UNINSTALL + rm -rf $serverPath/mysql-community + echo '卸载完成' +} + +action=$1 +if [ "${1}" == 'install' ];then + Install_mysql +else + Uninstall_mysql +fi diff --git a/plugins/mysql-community/versions/8.3/install_generic.sh b/plugins/mysql-community/versions/8.3/install_generic.sh new file mode 100755 index 0000000000..67debcca46 --- /dev/null +++ b/plugins/mysql-community/versions/8.3/install_generic.sh @@ -0,0 +1,81 @@ +# -*- 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-community + +OS_ARCH=`arch` +MYSQL_VER=8.3.0 +SUFFIX_NAME=${MYSQL_VER}-linux-glibc2.28-${OS_ARCH} + +# cd /www/server/mdserver-web/plugins/mysql-community && bash install.sh install 8.3 +# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-community/index.py start 8.3 +COMMUNITY_INSTALL() +{ + +######## +mkdir -p $myDir +mkdir -p $serverPath/mysql-community + +# 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-community +fi + +# 测试时可关闭 +rm -rf $myDir/mysql-${SUFFIX_NAME} +####### +} + +COMMUNITY_UNINSTALL() +{ +### +rm -rf $myDir/mysql-${SUFFIX_NAME} +### +} + + +Install_mysql() +{ + echo '正在安装脚本文件...' + COMMUNITY_INSTALL + if [ "$?" == "0" ];then + mkdir -p $serverPath/mysql-community + echo '8.3' > $serverPath/mysql-community/version.pl + echo '安装完成' + else + echo '8.3' > $serverPath/mysql-community/version.pl + echo "暂时不支持该系统" + fi +} + +Uninstall_mysql() +{ + + COMMUNITY_UNINSTALL + rm -rf $serverPath/mysql-APT_INSTALL + echo '卸载完成' +} + +action=$1 +if [ "${1}" == 'install' ];then + Install_mysql +else + Uninstall_mysql +fi diff --git a/plugins/mysql-community/versions/8.4/install_generic.sh b/plugins/mysql-community/versions/8.4/install_generic.sh new file mode 100755 index 0000000000..261e19a58e --- /dev/null +++ b/plugins/mysql-community/versions/8.4/install_generic.sh @@ -0,0 +1,80 @@ +# -*- 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-community + +OS_ARCH=`arch` +MYSQL_VER=8.4.2 +SUFFIX_NAME=${MYSQL_VER}-linux-glibc2.28-${OS_ARCH} + +# cd /www/server/mdserver-web/plugins/mysql-community && bash install.sh install 8.4 +# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-community/index.py start 8.4 +COMMUNITY_INSTALL() +{ +######## +mkdir -p $myDir +mkdir -p $serverPath/mysql-community + +# Linux - Generic +# https://cdn.mysql.com/archives/mysql-8.4/mysql-8.4.2-linux-glibc2.28-x86_64.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 +fi + +if [ -d ${myDir} ];then + cd ${myDir} && tar -Jxf ${myDir}/mysql-${SUFFIX_NAME}.tar.xz + cp -rf ${myDir}/mysql-${SUFFIX_NAME}/* $serverPath/mysql-community +fi + +# 测试时可关闭 +rm -rf $myDir/mysql-${SUFFIX_NAME} +####### +} + +COMMUNITY_UNINSTALL() +{ +### +rm -rf $myDir/mysql-${SUFFIX_NAME} +### +} + + +Install_mysql() +{ + echo '正在安装脚本文件...' + COMMUNITY_INSTALL + if [ "$?" == "0" ];then + mkdir -p $serverPath/mysql-community + echo '8.4' > $serverPath/mysql-community/version.pl + echo '安装完成' + else + echo '8.4' > $serverPath/mysql-community/version.pl + echo "暂时不支持该系统" + fi +} + +Uninstall_mysql() +{ + COMMUNITY_UNINSTALL + rm -rf $serverPath/mysql-community + echo '卸载完成' +} + +action=$1 +if [ "${1}" == 'install' ];then + Install_mysql +else + Uninstall_mysql +fi diff --git a/plugins/mysql-community/versions/9.0/install_generic.sh b/plugins/mysql-community/versions/9.0/install_generic.sh new file mode 100755 index 0000000000..cdf5c915e4 --- /dev/null +++ b/plugins/mysql-community/versions/9.0/install_generic.sh @@ -0,0 +1,80 @@ +# -*- 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-community + +OS_ARCH=`arch` +MYSQL_VER=9.0.1 +SUFFIX_NAME=${MYSQL_VER}-linux-glibc2.28-${OS_ARCH} + +# cd /www/server/mdserver-web/plugins/mysql-community && bash install.sh install 9.0 +# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-community/index.py start 9.0 +COMMUNITY_INSTALL() +{ + +######## +mkdir -p $myDir +mkdir -p $serverPath/mysql-community + +# Linux - Generic +# https://cdn.mysql.com/archives/mysql-9.0/mysql-9.0.1-linux-glibc2.28-x86_64.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-9.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-community +fi + +# 测试时可关闭 +rm -rf $myDir/mysql-${SUFFIX_NAME} +####### +} + +COMMUNITY_UNINSTALL() +{ +### +rm -rf $myDir/mysql-${SUFFIX_NAME} +### +} + + +Install_mysql() +{ + echo '正在安装脚本文件...' + COMMUNITY_INSTALL + if [ "$?" == "0" ];then + mkdir -p $serverPath/mysql-community + echo '9.0' > $serverPath/mysql-community/version.pl + echo '安装完成' + else + echo '9.0' > $serverPath/mysql-community/version.pl + echo "暂时不支持该系统" + fi +} + +Uninstall_mysql() +{ + COMMUNITY_UNINSTALL + rm -rf $serverPath/mysql-community + echo '卸载完成' +} + +action=$1 +if [ "${1}" == 'install' ];then + Install_mysql +else + Uninstall_mysql +fi diff --git a/plugins/mysql-community/versions/9.1/install_generic.sh b/plugins/mysql-community/versions/9.1/install_generic.sh new file mode 100755 index 0000000000..382e39040b --- /dev/null +++ b/plugins/mysql-community/versions/9.1/install_generic.sh @@ -0,0 +1,83 @@ +# -*- 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-community + +OS_ARCH=`arch` +MYSQL_VER=9.1.0 +SUFFIX_NAME=${MYSQL_VER}-linux-glibc2.28-${OS_ARCH} + +# cd /www/server/mdserver-web/plugins/mysql-community && bash install.sh install 9.1 +# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-community/index.py start 9.1 +COMMUNITY_INSTALL() +{ + +######## +mkdir -p $myDir +mkdir -p $serverPath/mysql-community + +# 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-${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/Downloads/MySQL-9.1/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-community +fi + +# 测试时可关闭 +rm -rf $myDir/mysql-${SUFFIX_NAME} +####### +} + +COMMUNITY_UNINSTALL() +{ +### +rm -rf $myDir/mysql-${SUFFIX_NAME} +# apt remove -y mysql-server +### +} + + +Install_mysql() +{ + echo '正在安装脚本文件...' + COMMUNITY_INSTALL + if [ "$?" == "0" ];then + mkdir -p $serverPath/mysql-community + echo '9.1' > $serverPath/mysql-community/version.pl + echo '安装完成' + else + echo '9.1' > $serverPath/mysql-community/version.pl + echo "暂时不支持该系统" + fi +} + +Uninstall_mysql() +{ + COMMUNITY_UNINSTALL + rm -rf $serverPath/mysql-community + echo '卸载完成' +} + +action=$1 +if [ "${1}" == 'install' ];then + Install_mysql +else + Uninstall_mysql +fi diff --git a/plugins/mysql-yum/conf/classic.cnf b/plugins/mysql-yum/conf/classic.cnf deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/plugins/mysql-yum/conf/gtid.cnf b/plugins/mysql-yum/conf/gtid.cnf deleted file mode 100644 index 5076776a65..0000000000 --- a/plugins/mysql-yum/conf/gtid.cnf +++ /dev/null @@ -1,4 +0,0 @@ -[mysqld] -# SHOW GLOBAL VARIABLES LIKE '%gtid%' -gtid_mode=ON -enforce_gtid_consistency=ON \ No newline at end of file diff --git a/plugins/mysql-yum/conf/my5.7.cnf b/plugins/mysql-yum/conf/my5.7.cnf deleted file mode 100644 index 72c7b0587b..0000000000 --- a/plugins/mysql-yum/conf/my5.7.cnf +++ /dev/null @@ -1,111 +0,0 @@ -[client] -user = root -#password = your_password -port = 33206 -socket = {$SERVER_APP_PATH}/mysql.sock -default-character-set = UTF8MB4 - -[mysqld] -!include {$SERVER_APP_PATH}/etc/mode/classic.cnf - -pid-file = {$SERVER_APP_PATH}/data/mysql.pid -user = mysql -port = 33206 -socket = {$SERVER_APP_PATH}/mysql.sock -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 -language={$SERVER_APP_PATH}/bin/usr/share/mysql/english - -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 - -query_cache_type = 1 -query_cache_size = 64M - -max_connections = 500 -max_connect_errors = 100 -open_files_limit = 2560 -max_allowed_packet = 128M - -skip_name_resolve = 1 -skip-ssl -#skip-networking -#skip-external-locking -#loose-skip-innodb -#skip-grant-tables - -log-bin=mysql-bin -binlog_format=mixed -slow_query_log=1 -slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log -long_query_time=3 -expire_logs_days=30 -#log_queries_not_using_indexes=on - -relay-log=mdserver -relay-log-index=mdserver - -#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-slave-updates -#replicate-do-db -slave_skip_errors=1062,1396 -replicate-ignore-db = information_schema -replicate-ignore-db = performance_schema -replicate-ignore-db = mysql -replicate-ignore-db = test - -master_info_repository = table -relay_log_info_repository = table - -default_storage_engine = InnoDB -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_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-yum/conf/my8.0.cnf b/plugins/mysql-yum/conf/my8.0.cnf deleted file mode 100644 index 92d6ac93d3..0000000000 --- a/plugins/mysql-yum/conf/my8.0.cnf +++ /dev/null @@ -1,103 +0,0 @@ -[client] -user = root -#password = your_password -port = 33206 -socket = {$SERVER_APP_PATH}/mysql.sock -default-character-set = UTF8MB4 - -[mysqld] -!include {$SERVER_APP_PATH}/etc/mode/classic.cnf - -authentication_policy=mysql_native_password -pid-file = {$SERVER_APP_PATH}/data/mysql.pid -user = mysql -port = 33206 -mysqlx_port = 33260 -socket = {$SERVER_APP_PATH}/mysql.sock -datadir = {$SERVER_APP_PATH}/data -log-error = {$SERVER_APP_PATH}/data/error.log -server-id = {$SERVER_ID} - -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=1 -tmp_table_size = 8M -character-set-server = UTF8MB4 - -max_connections = 500 -max_connect_errors = 100 -open_files_limit = 2560 -max_allowed_packet = 128M - -#skip-external-locking -#skip-grant-tables -#loose-skip-innodb -#skip-networking -#skip-name-resolve - -log-bin=mysql-bin -slow_query_log=1 -slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log -long_query_time=3 -#log_queries_not_using_indexes=on - -relay-log=mdserver -relay-log-index=mdserver - -#master -#binlog-do-db -#sync_binlog=1 - -binlog-ignore-db = test -binlog-ignore-db = mysql -binlog-ignore-db = information_schema -binlog-ignore-db = performance_schema - -#slave -log_replica_updates -#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 - -default_storage_engine = InnoDB -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_redo_log_capacity=10485760 -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 -binlog_expire_logs_seconds=2592000 - -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-yum/conf/my8.2.cnf b/plugins/mysql-yum/conf/my8.2.cnf deleted file mode 100644 index 58cca49b94..0000000000 --- a/plugins/mysql-yum/conf/my8.2.cnf +++ /dev/null @@ -1,105 +0,0 @@ -[client] -user = root -#password = your_password -port = 33206 -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 = 33206 -mysqlx_port = 33260 -socket = {$SERVER_APP_PATH}/mysql.sock -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=1 -tmp_table_size = 8M -character-set-server = UTF8MB4 - -max_connections = 500 -max_connect_errors = 100 -open_files_limit = 2560 -max_allowed_packet = 128M - -#skip-external-locking -#skip-grant-tables -#loose-skip-innodb -#skip-networking -#skip-name-resolve - -log-bin=mysql-bin -slow_query_log=1 -slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log -long_query_time=3 -#log_queries_not_using_indexes=on - -relay-log=mdserver -relay-log-index=mdserver - -#master -#binlog-do-db -#sync_binlog=1 - -binlog-ignore-db = test -binlog-ignore-db = mysql -binlog-ignore-db = information_schema -binlog-ignore-db = performance_schema - -#slave -log_replica_updates -#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 - - -default_storage_engine = InnoDB -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_redo_log_capacity=10485760 -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 -binlog_expire_logs_seconds=2592000 - -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-yum/conf/my8.3.cnf b/plugins/mysql-yum/conf/my8.3.cnf deleted file mode 100644 index 58cca49b94..0000000000 --- a/plugins/mysql-yum/conf/my8.3.cnf +++ /dev/null @@ -1,105 +0,0 @@ -[client] -user = root -#password = your_password -port = 33206 -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 = 33206 -mysqlx_port = 33260 -socket = {$SERVER_APP_PATH}/mysql.sock -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=1 -tmp_table_size = 8M -character-set-server = UTF8MB4 - -max_connections = 500 -max_connect_errors = 100 -open_files_limit = 2560 -max_allowed_packet = 128M - -#skip-external-locking -#skip-grant-tables -#loose-skip-innodb -#skip-networking -#skip-name-resolve - -log-bin=mysql-bin -slow_query_log=1 -slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log -long_query_time=3 -#log_queries_not_using_indexes=on - -relay-log=mdserver -relay-log-index=mdserver - -#master -#binlog-do-db -#sync_binlog=1 - -binlog-ignore-db = test -binlog-ignore-db = mysql -binlog-ignore-db = information_schema -binlog-ignore-db = performance_schema - -#slave -log_replica_updates -#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 - - -default_storage_engine = InnoDB -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_redo_log_capacity=10485760 -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 -binlog_expire_logs_seconds=2592000 - -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-yum/conf/my8.4.cnf b/plugins/mysql-yum/conf/my8.4.cnf deleted file mode 100644 index fe2adacbcc..0000000000 --- a/plugins/mysql-yum/conf/my8.4.cnf +++ /dev/null @@ -1,104 +0,0 @@ -[client] -user = root -#password = your_password -port = 33206 -socket = {$SERVER_APP_PATH}/mysql.sock -default-character-set = UTF8MB4 - -[mysqld] -!include {$SERVER_APP_PATH}/etc/mode/classic.cnf -#mysql_native_password=ON -authentication_policy=caching_sha2_password -pid-file = {$SERVER_APP_PATH}/data/mysql.pid -user = mysql -port = 33206 -#mysqlx_port = 33260 -socket = {$SERVER_APP_PATH}/mysql.sock -datadir = {$SERVER_APP_PATH}/data -log-error = {$SERVER_APP_PATH}/data/error.log -server-id = {$SERVER_ID} - -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=1 -tmp_table_size = 8M -character-set-server = UTF8MB4 - -max_connections = 500 -max_connect_errors = 100 -open_files_limit = 2560 -max_allowed_packet = 128M - -#skip-external-locking -#skip-grant-tables -#loose-skip-innodb -#skip-networking -#skip-name-resolve - -log-bin=mysql-bin -slow_query_log=1 -slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log -long_query_time=3 -#log_queries_not_using_indexes=on - -relay-log=mdserver -relay-log-index=mdserver - -#master -#binlog-do-db -#sync_binlog=1 - -binlog-ignore-db = test -binlog-ignore-db = mysql -binlog-ignore-db = information_schema -binlog-ignore-db = performance_schema - -#slave -log_replica_updates -#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 - - -default_storage_engine = InnoDB -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_redo_log_capacity=10485760 -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 -binlog_expire_logs_seconds=2592000 - -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-yum/conf/my9.0.cnf b/plugins/mysql-yum/conf/my9.0.cnf deleted file mode 100644 index fe2adacbcc..0000000000 --- a/plugins/mysql-yum/conf/my9.0.cnf +++ /dev/null @@ -1,104 +0,0 @@ -[client] -user = root -#password = your_password -port = 33206 -socket = {$SERVER_APP_PATH}/mysql.sock -default-character-set = UTF8MB4 - -[mysqld] -!include {$SERVER_APP_PATH}/etc/mode/classic.cnf -#mysql_native_password=ON -authentication_policy=caching_sha2_password -pid-file = {$SERVER_APP_PATH}/data/mysql.pid -user = mysql -port = 33206 -#mysqlx_port = 33260 -socket = {$SERVER_APP_PATH}/mysql.sock -datadir = {$SERVER_APP_PATH}/data -log-error = {$SERVER_APP_PATH}/data/error.log -server-id = {$SERVER_ID} - -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=1 -tmp_table_size = 8M -character-set-server = UTF8MB4 - -max_connections = 500 -max_connect_errors = 100 -open_files_limit = 2560 -max_allowed_packet = 128M - -#skip-external-locking -#skip-grant-tables -#loose-skip-innodb -#skip-networking -#skip-name-resolve - -log-bin=mysql-bin -slow_query_log=1 -slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log -long_query_time=3 -#log_queries_not_using_indexes=on - -relay-log=mdserver -relay-log-index=mdserver - -#master -#binlog-do-db -#sync_binlog=1 - -binlog-ignore-db = test -binlog-ignore-db = mysql -binlog-ignore-db = information_schema -binlog-ignore-db = performance_schema - -#slave -log_replica_updates -#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 - - -default_storage_engine = InnoDB -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_redo_log_capacity=10485760 -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 -binlog_expire_logs_seconds=2592000 - -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-yum/conf/mysql.sql b/plugins/mysql-yum/conf/mysql.sql deleted file mode 100755 index f98ddf79b9..0000000000 --- a/plugins/mysql-yum/conf/mysql.sql +++ /dev/null @@ -1,58 +0,0 @@ -CREATE TABLE IF NOT EXISTS `config` ( - `id` INTEGER PRIMARY KEY AUTOINCREMENT, - `mysql_root` TEXT -); - -INSERT INTO `config` (`id`, `mysql_root`) VALUES (1, 'admin'); - -CREATE TABLE IF NOT EXISTS `databases` ( - `id` INTEGER PRIMARY KEY AUTOINCREMENT, - `pid` INTEGER, - `name` TEXT, - `username` TEXT, - `password` TEXT, - `accept` TEXT, - `rw` TEXT DEFAULT 'rw', - `ps` TEXT, - `addtime` TEXT -); --- ALTER TABLE `databases` ADD COLUMN `rw` TEXT DEFAULT 'rw'; - -CREATE TABLE IF NOT EXISTS `master_replication_user` ( - `id` INTEGER PRIMARY KEY AUTOINCREMENT, - `username` TEXT, - `password` TEXT, - `accept` TEXT, - `ps` TEXT, - `addtime` TEXT -); - --- 从库配置主库的[ssh private key] --- drop table `slave_id_rsa`; -CREATE TABLE IF NOT EXISTS `slave_id_rsa` ( - `id` INTEGER PRIMARY KEY AUTOINCREMENT, - `ip` TEXT, - `port` TEXT, - `user` TEXT, - `db_user` TEXT, - `id_rsa` TEXT, - `ps` TEXT, - `addtime` TEXT -); - --- 从库配置主库的[user] --- drop table `slave_user`; -CREATE TABLE IF NOT EXISTS `slave_sync_user` ( - `id` INTEGER PRIMARY KEY AUTOINCREMENT, - `ip` TEXT, - `port` TEXT, - `user` TEXT, - `pass` TEXT, - `mode` TEXT, - `cmd` TEXT, - `db` TEXT, - `addtime` TEXT -); -ALTER TABLE `slave_sync_user` ADD COLUMN `db` TEXT DEFAULT ''; - - diff --git a/plugins/mysql-yum/ico.png b/plugins/mysql-yum/ico.png deleted file mode 100644 index ead815fc20..0000000000 Binary files a/plugins/mysql-yum/ico.png and /dev/null differ diff --git a/plugins/mysql-yum/index.html b/plugins/mysql-yum/index.html deleted file mode 100755 index 57d4d9f63e..0000000000 --- a/plugins/mysql-yum/index.html +++ /dev/null @@ -1,59 +0,0 @@ -服务
-自启动
-配置文件
-存储位置
-端口
-当前状态
-性能优化
-日志
-慢日志
-BINLOG
-管理列表
-主从配置
-启动时间 | ' + getLocalTime(rdata.Run) + ' | 每秒查询 | ' + parseInt(rdata.Questions / rdata.Uptime) + ' |
---|---|---|---|
总连接次数 | ' + rdata.Connections + ' | 每秒事务 | ' + parseInt((parseInt(rdata.Com_commit) + parseInt(rdata.Com_rollback)) / rdata.Uptime) + ' |
发送 | ' + toSize(rdata.Bytes_sent) + ' | File | ' + rdata.File + ' |
接收 | ' + toSize(rdata.Bytes_received) + ' | Position | ' + rdata.Position + ' |
\ - \ - | |||
---|---|---|---|
活动/峰值连接数 | ' + rdata.Threads_running + '/' + rdata.Max_used_connections + ' | 若值过大,增加max_connections | |
线程缓存命中率 | ' + ((1 - rdata.Threads_created / rdata.Connections) * 100).toFixed(2) + '% | 若过低,增加thread_cache_size | |
索引命中率 | ' + ((1 - rdata.Key_reads / rdata.Key_read_requests) * 100).toFixed(2) + '% | 若过低,增加key_buffer_size | |
Innodb索引命中率 | ' + (rdata.Innodb_buffer_pool_read_requests / (rdata.Innodb_buffer_pool_read_requests+rdata.Innodb_buffer_pool_reads)).toFixed(2) + '% | 若过低,增加innodb_buffer_pool_size | |
查询缓存命中率 | ' + cache_size + ' | ' + lan.soft.mysql_status_ps5 + ' | |
创建临时表到磁盘 | ' + ((rdata.Created_tmp_disk_tables / rdata.Created_tmp_tables) * 100).toFixed(2) + '% | 若过大,尝试增加tmp_table_size | |
已打开的表 | ' + rdata.Open_tables + ' | 若过大,增加table_cache_size | |
没有使用索引的量 | ' + rdata.Select_full_join + ' | 若不为0,请检查数据表的索引是否合理 | |
没有索引的JOIN量 | ' + rdata.Select_range_check + ' | 若不为0,请检查数据表的索引是否合理 | |
排序后的合并次数 | ' + rdata.Sort_merge_passes + ' | 若值过大,增加sort_buffer_size | |
锁表次数 | ' + rdata.Table_locks_waited + ' | 若值过大,请考虑增加您的数据库性能 |
key_buffer_sizeMB, ' + lan.soft.mysql_set_key_buffer_size + '
\ -query_cache_sizeMB, ' + lan.soft.mysql_set_query_cache_size + '
\ -tmp_table_sizeMB, ' + lan.soft.mysql_set_tmp_table_size + '
\ -innodb_buffer_pool_sizeMB, ' + lan.soft.mysql_set_innodb_buffer_pool_size + '
\ -innodb_log_buffer_sizeMB, ' + lan.soft.mysql_set_innodb_log_buffer_size + '
\ -innodb_additional_mem_pool_sizeMB
\ -sort_buffer_sizeKB * ' + lan.soft.mysql_set_conn + ', ' + lan.soft.mysql_set_sort_buffer_size + '
\ -read_buffer_sizeKB * ' + lan.soft.mysql_set_conn + ', ' + lan.soft.mysql_set_read_buffer_size + '
\ -read_rnd_buffer_sizeKB * ' + lan.soft.mysql_set_conn + ', ' + lan.soft.mysql_set_read_rnd_buffer_size + '
\ -join_buffer_sizeKB * ' + lan.soft.mysql_set_conn + ', ' + lan.soft.mysql_set_join_buffer_size + '
\ -thread_stackKB * ' + lan.soft.mysql_set_conn + ', ' + lan.soft.mysql_set_thread_stack + '
\ -binlog_cache_sizeKB * ' + lan.soft.mysql_set_conn + ', ' + lan.soft.mysql_set_binlog_cache_size + '
\ -thread_cache_size ' + lan.soft.mysql_set_thread_cache_size + '
\ -table_open_cache ' + lan.soft.mysql_set_table_open_cache + '
\ -max_connections ' + lan.soft.mysql_set_max_connections + '
\ - \ -物理内存: {1}MB
最大使用内存: {2}MB
可能造成的后果: 导致数据库不稳定,甚至无法启动MySQLd服务!";
- var msg = errMsg.replace('{1}',memSize).replace('{2}',setSize);
- layer.msg(msg,{icon:2,time:5000});
- return;
- }
-
- var query_cache_size = parseInt($("input[name='query_cache_size']").val());
- var query_cache_type = 0;
- if (query_cache_size > 0) {
- query_cache_type = 1;
- }
- var data = {
- key_buffer_size: parseInt($("input[name='key_buffer_size']").val()),
- query_cache_size: query_cache_size,
- query_cache_type: query_cache_type,
- tmp_table_size: parseInt($("input[name='tmp_table_size']").val()),
- max_heap_table_size: parseInt($("input[name='tmp_table_size']").val()),
- innodb_buffer_pool_size: parseInt($("input[name='innodb_buffer_pool_size']").val()),
- innodb_log_buffer_size: parseInt($("input[name='innodb_log_buffer_size']").val()),
- sort_buffer_size: parseInt($("input[name='sort_buffer_size']").val()),
- read_buffer_size: parseInt($("input[name='read_buffer_size']").val()),
- read_rnd_buffer_size: parseInt($("input[name='read_rnd_buffer_size']").val()),
- join_buffer_size: parseInt($("input[name='join_buffer_size']").val()),
- thread_stack: parseInt($("input[name='thread_stack']").val()),
- binlog_cache_size: parseInt($("input[name='binlog_cache_size']").val()),
- thread_cache_size: parseInt($("input[name='thread_cache_size']").val()),
- table_open_cache: parseInt($("input[name='table_open_cache']").val()),
- max_connections: parseInt($("input[name='max_connections']").val())
- };
-
- myPost('set_db_status', data, function(data){
- var rdata = $.parseJSON(data.data);
- showMsg(rdata.msg,function(){
- reBootMySqld();
- },{ icon: rdata.status ? 1 : 2 });
- });
- },'json');
-}
-
-
-//MySQL内存优化方案
-function mySQLMemOpt(opt) {
- var query_size = parseInt($("input[name='query_cache_size']").val());
- switch (opt) {
- case '0':
- $("input[name='key_buffer_size']").val(8);
- if (query_size) $("input[name='query_cache_size']").val(4);
- $("input[name='tmp_table_size']").val(8);
- $("input[name='innodb_buffer_pool_size']").val(16);
- $("input[name='sort_buffer_size']").val(256);
- $("input[name='read_buffer_size']").val(256);
- $("input[name='read_rnd_buffer_size']").val(128);
- $("input[name='join_buffer_size']").val(128);
- $("input[name='thread_stack']").val(256);
- $("input[name='binlog_cache_size']").val(32);
- $("input[name='thread_cache_size']").val(4);
- $("input[name='table_open_cache']").val(32);
- $("input[name='max_connections']").val(500);
- break;
- case '1':
- $("input[name='key_buffer_size']").val(128);
- if (query_size) $("input[name='query_cache_size']").val(64);
- $("input[name='tmp_table_size']").val(64);
- $("input[name='innodb_buffer_pool_size']").val(256);
- $("input[name='sort_buffer_size']").val(768);
- $("input[name='read_buffer_size']").val(768);
- $("input[name='read_rnd_buffer_size']").val(512);
- $("input[name='join_buffer_size']").val(1024);
- $("input[name='thread_stack']").val(256);
- $("input[name='binlog_cache_size']").val(64);
- $("input[name='thread_cache_size']").val(64);
- $("input[name='table_open_cache']").val(128);
- $("input[name='max_connections']").val(100);
- break;
- case '2':
- $("input[name='key_buffer_size']").val(256);
- if (query_size) $("input[name='query_cache_size']").val(128);
- $("input[name='tmp_table_size']").val(384);
- $("input[name='innodb_buffer_pool_size']").val(384);
- $("input[name='sort_buffer_size']").val(768);
- $("input[name='read_buffer_size']").val(768);
- $("input[name='read_rnd_buffer_size']").val(512);
- $("input[name='join_buffer_size']").val(2048);
- $("input[name='thread_stack']").val(256);
- $("input[name='binlog_cache_size']").val(64);
- $("input[name='thread_cache_size']").val(96);
- $("input[name='table_open_cache']").val(192);
- $("input[name='max_connections']").val(200);
- break;
- case '3':
- $("input[name='key_buffer_size']").val(384);
- if (query_size) $("input[name='query_cache_size']").val(192);
- $("input[name='tmp_table_size']").val(512);
- $("input[name='innodb_buffer_pool_size']").val(512);
- $("input[name='sort_buffer_size']").val(1024);
- $("input[name='read_buffer_size']").val(1024);
- $("input[name='read_rnd_buffer_size']").val(768);
- $("input[name='join_buffer_size']").val(2048);
- $("input[name='thread_stack']").val(256);
- $("input[name='binlog_cache_size']").val(128);
- $("input[name='thread_cache_size']").val(128);
- $("input[name='table_open_cache']").val(384);
- $("input[name='max_connections']").val(300);
- break;
- case '4':
- $("input[name='key_buffer_size']").val(512);
- if (query_size) $("input[name='query_cache_size']").val(256);
- $("input[name='tmp_table_size']").val(1024);
- $("input[name='innodb_buffer_pool_size']").val(1024);
- $("input[name='sort_buffer_size']").val(2048);
- $("input[name='read_buffer_size']").val(2048);
- $("input[name='read_rnd_buffer_size']").val(1024);
- $("input[name='join_buffer_size']").val(4096);
- $("input[name='thread_stack']").val(384);
- $("input[name='binlog_cache_size']").val(192);
- $("input[name='thread_cache_size']").val(192);
- $("input[name='table_open_cache']").val(1024);
- $("input[name='max_connections']").val(400);
- break;
- case '5':
- $("input[name='key_buffer_size']").val(1024);
- if (query_size) $("input[name='query_cache_size']").val(384);
- $("input[name='tmp_table_size']").val(2048);
- $("input[name='innodb_buffer_pool_size']").val(4096);
- $("input[name='sort_buffer_size']").val(4096);
- $("input[name='read_buffer_size']").val(4096);
- $("input[name='read_rnd_buffer_size']").val(2048);
- $("input[name='join_buffer_size']").val(8192);
- $("input[name='thread_stack']").val(512);
- $("input[name='binlog_cache_size']").val(256);
- $("input[name='thread_cache_size']").val(256);
- $("input[name='table_open_cache']").val(2048);
- $("input[name='max_connections']").val(500);
- break;
- }
-}
-
-//计算MySQL内存开销
-function comMySqlMem() {
- var key_buffer_size = parseInt($("input[name='key_buffer_size']").val());
- var query_cache_size = parseInt($("input[name='query_cache_size']").val());
- var tmp_table_size = parseInt($("input[name='tmp_table_size']").val());
- var innodb_buffer_pool_size = parseInt($("input[name='innodb_buffer_pool_size']").val());
- var innodb_additional_mem_pool_size = parseInt($("input[name='innodb_additional_mem_pool_size']").val());
- var innodb_log_buffer_size = parseInt($("input[name='innodb_log_buffer_size']").val());
-
- var sort_buffer_size = $("input[name='sort_buffer_size']").val() / 1024;
- var read_buffer_size = $("input[name='read_buffer_size']").val() / 1024;
- var read_rnd_buffer_size = $("input[name='read_rnd_buffer_size']").val() / 1024;
- var join_buffer_size = $("input[name='join_buffer_size']").val() / 1024;
- var thread_stack = $("input[name='thread_stack']").val() / 1024;
- var binlog_cache_size = $("input[name='binlog_cache_size']").val() / 1024;
- var max_connections = $("input[name='max_connections']").val();
-
- var a = key_buffer_size + query_cache_size + tmp_table_size + innodb_buffer_pool_size + innodb_additional_mem_pool_size + innodb_log_buffer_size
- var b = sort_buffer_size + read_buffer_size + read_rnd_buffer_size + join_buffer_size + thread_stack + binlog_cache_size
- var memSize = a + max_connections * b
- $("input[name='memSize']").val(memSize.toFixed(2));
-}
-
-function syncGetDatabase(){
- myPost('sync_get_databases', null, function(data){
- var rdata = $.parseJSON(data.data);
- showMsg(rdata.msg,function(){
- dbList();
- },{ icon: rdata.status ? 1 : 2 });
- });
-}
-
-function syncToDatabase(type){
- var data = [];
- $('input[type="checkbox"].check:checked').each(function () {
- if (!isNaN($(this).val())) data.push($(this).val());
- });
- var postData = 'type='+type+'&ids='+JSON.stringify(data);
- myPost('sync_to_databases', postData, function(data){
- var rdata = $.parseJSON(data.data);
- // console.log(rdata);
- showMsg(rdata.msg,function(){
- dbList();
- },{ icon: rdata.status ? 1 : 2 });
- });
-}
-
-function setRootPwd(type, pwd){
- if (type==1){
- var password = $("#MyPassword").val();
- myPost('set_root_pwd', {password:password}, function(data){
- var rdata = $.parseJSON(data.data);
- showMsg(rdata.msg,function(){
- dbList();
- },{icon: rdata.status ? 1 : 2});
- });
- return;
- }
-
- var index = layer.open({
- type: 1,
- area: '500px',
- title: '修改数据库密码',
- closeBtn: 1,
- shift: 5,
- btn:["提交", "关闭", "复制ROOT密码", "强制修改"],
- shadeClose: true,
- content: "
'+rdata.data+'\ -
'+rdata.data+'\ -
文件名称 | \ -文件大小 | \ -备份时间 | \ -操作 | \ -
---|
文件名称 | \ -文件大小 | \ -备份时间 | \ -操作 | \ -
---|
\ - | 数据库名 | \ -用户名 | \ -密码 | \ - '+ - // '备份 | '+ - '备注 | \ -操作 |
---|
cmd | \ -\ - |
文件名称 | \ -大小 | \ -时间 | \ -操作 | \ -
---|
\ - 二进制日志 ' + toSize(rdata.msg) + '\ - '+line_status+'\ -
错误日志
\ - \ - '; - $(".soft-man-con").html(limitCon); - - //设置二进制日志 - $(".btn-bin").click(function () { - myPost('bin_log', 'close=change', function(data){ - var rdata = $.parseJSON(data.data); - layer.msg(rdata.msg, { icon: rdata.status ? 1 : 5 }); - setTimeout(function(){myLogs();}, 2000); - }); - }); - - $(".clean-btn-bin").click(function () { - myPost('clean_bin_log', '', function(data){ - var rdata = $.parseJSON(data.data); - layer.msg(rdata.msg, { icon: rdata.status ? 1 : 5 }); - setTimeout(function(){myLogs();}, 2000); - }); - }); - - //清空日志 - $(".btn-clear").click(function () { - myPost('error_log', 'close=1', function(data){ - var rdata = $.parseJSON(data.data); - layer.msg(rdata.msg, { icon: rdata.status ? 1 : 5 }); - setTimeout(function(){myLogs();}, 2000); - }); - }) - - myPost('error_log', 'p=1', function(data){ - var rdata = $.parseJSON(data.data); - var error_body = ''; - if (rdata.status){ - error_body = rdata.data; - } else { - error_body = rdata.msg; - } - $("#error_log").html(error_body); - var ob = document.getElementById('error_log'); - ob.scrollTop = ob.scrollHeight; - }); - }); -} - - -function repCheckeds(tables) { - var dbs = [] - if (tables) { - dbs.push(tables) - } else { - var db_tools = $("input[value^='dbtools_']"); - for (var i = 0; i < db_tools.length; i++) { - if (db_tools[i].checked) dbs.push(db_tools[i].value.replace('dbtools_', '')); - } - } - - if (dbs.length < 1) { - layer.msg('请至少选择一张表!', { icon: 2 }); - return false; - } - return dbs; -} - -function repDatabase(db_name, tables) { - dbs = repCheckeds(tables); - - myPost('repair_table', { db_name: db_name, tables: JSON.stringify(dbs) }, function(data){ - var rdata = $.parseJSON(data.data); - layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 }); - repTools(db_name, true); - },'已送修复指令,请稍候...'); -} - - -function optDatabase(db_name, tables) { - dbs = repCheckeds(tables); - - myPost('opt_table', { db_name: db_name, tables: JSON.stringify(dbs) }, function(data){ - var rdata = $.parseJSON(data.data); - layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 }); - repTools(db_name, true); - },'已送优化指令,请稍候...'); -} - -function toDatabaseType(db_name, tables, type){ - dbs = repCheckeds(tables); - myPost('alter_table', { db_name: db_name, tables: JSON.stringify(dbs),table_type: type }, function(data){ - var rdata = $.parseJSON(data.data); - layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 }); - repTools(db_name, true); - }, '已送引擎转换指令,请稍候...'); -} - - -function selectedTools(my_obj, db_name) { - var is_checked = false - - if (my_obj) is_checked = my_obj.checked; - var db_tools = $("input[value^='dbtools_']"); - var n = 0; - for (var i = 0; i < db_tools.length; i++) { - if (my_obj) db_tools[i].checked = is_checked; - if (db_tools[i].checked) n++; - } - if (n > 0) { - var my_btns = '\ - \ - \ - ' - $("#db_tools").html(my_btns); - } else { - $("#db_tools").html(''); - } -} - -function repTools(db_name, res){ - myPost('get_db_info', {name:db_name}, function(data){ - var rdata = $.parseJSON(data.data); - var types = { InnoDB: "MyISAM", MyISAM: "InnoDB" }; - var tbody = ''; - for (var i = 0; i < rdata.tables.length; i++) { - if (!types[rdata.tables[i].type]) continue; - tbody += '\ - | 表名 | \ -引擎 | \ -字符集 | \ -行数 | \ -大小 | \ -操作 | \ -
---|
用户名 | 密码 | 操作 |
---|
\ - 同步数据源:\ - \ -
"; - } - - layer.open({ - type: 1, - title: '全量同步['+db+']', - area: '500px', - content:"'+rdata.data+'\ -
'+rdata.data+'\ -
\ - 当前从库同步模式\ - \ - \ - \ - \ -
\ -\ - 配置设置\ - \ - \ - \ -
\ -IP | PORT | 同步账户 | 同步密码 | CMD | 操作 |
---|
IP | PORT | 同步账户 | SSH | 操作 |
---|
数据库名 | \ -同步 | \ -操作 |
---|
主[服务] | \ -端口 | \ -用户 | \ -日志 | \ -IO | \ -SQL | \ - '+signThead_th+'\ -状态 | \ -操作 |
---|
本地库名 | \ -操作 |
---|
\ - 主从同步模式\ - \ - \ -
\ -\ - Master[主]配置\ - \ - \ -
\ -\ - Slave[从]配置\ - \ - \ - \ -
\ -