From 48bcf77deba50e9288d93148ca2ed68b333ad6f3 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 14 Apr 2025 16:54:00 +0800 Subject: [PATCH 1/2] Create mysql9.2.service.tpl --- .../init.d/mysql9.2.service.tpl | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 plugins/mysql-community/init.d/mysql9.2.service.tpl diff --git a/plugins/mysql-community/init.d/mysql9.2.service.tpl b/plugins/mysql-community/init.d/mysql9.2.service.tpl new file mode 100644 index 000000000..9de86ce28 --- /dev/null +++ b/plugins/mysql-community/init.d/mysql9.2.service.tpl @@ -0,0 +1,49 @@ +# Copyright (c) 2015, 2022, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, +# as published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an additional +# permission to link the program and your derivative works with the +# separately licensed software that they have included with MySQL. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# MySQL systemd service file + +[Unit] +Description=MySQL Community Server +Documentation=man:mysqld(8) +Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html +After=network.target + +[Install] +WantedBy=multi-user.target + +[Service] +User=mysql +Group=mysql +Type=notify +ExecStart={$SERVER_PATH}/mysql-community/bin/mysqld --defaults-file={$SERVER_PATH}/mysql-community/etc/my.cnf +TimeoutSec=600 +LimitNOFILE = 10000 +Restart=on-failure +RestartPreventExitStatus=1 + +# Always restart when mysqld exits with exit code of 16. This special exit code +# is used by mysqld for RESTART SQL. +RestartForceExitStatus=16 + +# Set enviroment variable MYSQLD_PARENT_PID. This is required for restart. +Environment=MYSQLD_PARENT_PID=1 From a8bd5cbbebb348d9d9d2c18fd07f484055687696 Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 14 Apr 2025 16:57:05 +0800 Subject: [PATCH 2/2] Update index.py --- plugins/mysql-community/index.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/mysql-community/index.py b/plugins/mysql-community/index.py index 390567b6a..da34ccb5d 100755 --- a/plugins/mysql-community/index.py +++ b/plugins/mysql-community/index.py @@ -727,7 +727,7 @@ def myDbStatus(version): gets = ['table_open_cache', 'thread_cache_size', 'key_buffer_size', 'tmp_table_size', 'max_heap_table_size', 'innodb_buffer_pool_size', 'innodb_additional_mem_pool_size', 'innodb_log_buffer_size', 'max_connections', 'sort_buffer_size', 'read_buffer_size', 'read_rnd_buffer_size', 'join_buffer_size', 'thread_stack', 'binlog_cache_size'] - if pk_version.parse(ver) < pk_version.parse("8.0"): + if pk_version.parse(version) < pk_version.parse("8.0"): gets.append('query_cache_size') result['mem'] = {} @@ -744,7 +744,7 @@ def setDbStatus(version): gets = ['key_buffer_size', 'tmp_table_size', 'max_heap_table_size', 'innodb_buffer_pool_size', 'innodb_log_buffer_size', 'max_connections', 'table_open_cache', 'thread_cache_size', 'sort_buffer_size', 'read_buffer_size', 'read_rnd_buffer_size', 'join_buffer_size', 'thread_stack', 'binlog_cache_size'] - if pk_version.parse(ver) < pk_version.parse("8.0"): + if pk_version.parse(version) < pk_version.parse("8.0"): gets = ['key_buffer_size', 'query_cache_size', 'tmp_table_size', 'max_heap_table_size', 'innodb_buffer_pool_size', 'innodb_log_buffer_size', 'max_connections', 'table_open_cache', 'thread_cache_size', 'sort_buffer_size', 'read_buffer_size', 'read_rnd_buffer_size', 'join_buffer_size', 'thread_stack', 'binlog_cache_size']