From 7813ddf87520e7fcd893a37019fb4e1ffd199d92 Mon Sep 17 00:00:00 2001 From: okxlin Date: Sun, 15 Dec 2024 17:53:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=90=8C=E6=AD=A5=E4=B8=8A=E6=B8=B8MySQL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/mysql/{8.4.0 => 8.0.40}/conf/my.cnf | 0 apps/mysql/8.0.40/data.yml | 17 ++++++++ .../{8.4.0 => 8.0.40}/docker-compose.yml | 3 +- apps/mysql/8.4.3/conf/my.cnf | 13 ++++++ apps/mysql/{8.4.0 => 8.4.3}/data.yml | 0 apps/mysql/8.4.3/docker-compose.yml | 24 +++++++++++ apps/mysql/8.4.3/scripts/upgrade.sh | 9 ++++ apps/mysql/README.md | 43 +++++++++++++------ apps/mysql/README_en.md | 37 ++++++++++++++++ 9 files changed, 131 insertions(+), 15 deletions(-) rename apps/mysql/{8.4.0 => 8.0.40}/conf/my.cnf (100%) create mode 100644 apps/mysql/8.0.40/data.yml rename apps/mysql/{8.4.0 => 8.0.40}/docker-compose.yml (96%) create mode 100644 apps/mysql/8.4.3/conf/my.cnf rename apps/mysql/{8.4.0 => 8.4.3}/data.yml (100%) create mode 100644 apps/mysql/8.4.3/docker-compose.yml create mode 100644 apps/mysql/8.4.3/scripts/upgrade.sh create mode 100644 apps/mysql/README_en.md diff --git a/apps/mysql/8.4.0/conf/my.cnf b/apps/mysql/8.0.40/conf/my.cnf similarity index 100% rename from apps/mysql/8.4.0/conf/my.cnf rename to apps/mysql/8.0.40/conf/my.cnf diff --git a/apps/mysql/8.0.40/data.yml b/apps/mysql/8.0.40/data.yml new file mode 100644 index 00000000..e71c6a38 --- /dev/null +++ b/apps/mysql/8.0.40/data.yml @@ -0,0 +1,17 @@ +additionalProperties: + formFields: + - default: mysql + envKey: PANEL_DB_ROOT_PASSWORD + labelEn: Root Password + labelZh: root用户密码 + random: true + required: true + rule: paramComplexity + type: password + - default: 3306 + envKey: PANEL_APP_PORT_HTTP + labelEn: Port + labelZh: 端口 + required: true + rule: paramPort + type: number diff --git a/apps/mysql/8.4.0/docker-compose.yml b/apps/mysql/8.0.40/docker-compose.yml similarity index 96% rename from apps/mysql/8.4.0/docker-compose.yml rename to apps/mysql/8.0.40/docker-compose.yml index 7b012e9d..33626b30 100644 --- a/apps/mysql/8.4.0/docker-compose.yml +++ b/apps/mysql/8.0.40/docker-compose.yml @@ -1,7 +1,6 @@ - services: mysql: - image: mysql:8.4.0 + image: mysql:8.0.40 container_name: ${CONTAINER_NAME} restart: always environment: diff --git a/apps/mysql/8.4.3/conf/my.cnf b/apps/mysql/8.4.3/conf/my.cnf new file mode 100644 index 00000000..13e999b0 --- /dev/null +++ b/apps/mysql/8.4.3/conf/my.cnf @@ -0,0 +1,13 @@ +[mysqld] +host-cache-size=0 +skip-name-resolve +datadir=/var/lib/mysql +socket=/var/run/mysqld/mysqld.sock +secure-file-priv=/var/lib/mysql-files +user=mysql + +pid-file=/var/run/mysqld/mysqld.pid +[client] +socket=/var/run/mysqld/mysqld.sock + +!includedir /etc/mysql/conf.d/ \ No newline at end of file diff --git a/apps/mysql/8.4.0/data.yml b/apps/mysql/8.4.3/data.yml similarity index 100% rename from apps/mysql/8.4.0/data.yml rename to apps/mysql/8.4.3/data.yml diff --git a/apps/mysql/8.4.3/docker-compose.yml b/apps/mysql/8.4.3/docker-compose.yml new file mode 100644 index 00000000..e0d227dd --- /dev/null +++ b/apps/mysql/8.4.3/docker-compose.yml @@ -0,0 +1,24 @@ +services: + mysql: + image: mysql:8.4.3 + container_name: ${CONTAINER_NAME} + restart: always + environment: + MYSQL_ROOT_PASSWORD: ${PANEL_DB_ROOT_PASSWORD} + networks: + - 1panel-network + ports: + - ${PANEL_APP_PORT_HTTP}:3306 + volumes: + - ./data/:/var/lib/mysql + - ./conf/my.cnf:/etc/my.cnf + - ./log:/var/log/mysql + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + labels: + createdBy: "Apps" + command: + - --mysql-native-password=on +networks: + 1panel-network: + external: true diff --git a/apps/mysql/8.4.3/scripts/upgrade.sh b/apps/mysql/8.4.3/scripts/upgrade.sh new file mode 100644 index 00000000..029df7a7 --- /dev/null +++ b/apps/mysql/8.4.3/scripts/upgrade.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +CONFIG_FILE="./conf/my.cnf" + +if grep -q "skip-host-cache" "$CONFIG_FILE"; then + sed -i '/skip-host-cache/d' "$CONFIG_FILE" +else + echo "'skip-host-cache' does not exist in the configuration file." +fi \ No newline at end of file diff --git a/apps/mysql/README.md b/apps/mysql/README.md index 7951cf6a..a9088d51 100644 --- a/apps/mysql/README.md +++ b/apps/mysql/README.md @@ -1,20 +1,37 @@ -Copyright (c) 2000, 2022, Oracle and/or its affiliates. +# MySQL -This is a release of MySQL, an SQL database server. +MySQL是一个流行的开源关系型数据库管理系统(RDBMS),它提供了丰富的功能,适用于各种应用场景。 -License information can be found in the LICENSE file. +## 主要功能: -In test packages where this file is renamed README-test, the license -file is renamed LICENSE-test. +### 数据存储和管理 -This distribution may include materials developed by third parties. -For license and attribution notices for these materials, -please refer to the LICENSE file. +MySQL允许用户创建、存储和管理大量的数据。它支持多种数据类型,包括整数、浮点数、字符串、日期等,以满足不同类型的数据需求。 -For further information on MySQL or additional documentation, visit -http://dev.mysql.com/doc/ +### 数据检索和查询 -For additional downloads and the source of MySQL, visit -http://dev.mysql.com/downloads/ +MySQL提供强大的查询功能,允许用户使用SQL(Structured Query Language)语言来检索和过滤数据。用户可以执行各种复杂的查询操作,包括筛选、排序、分组和连接多个表格中的数据。 -MySQL is brought to you by the MySQL team at Oracle. +### 数据完整性和约束 + +MySQL支持数据完整性和约束,包括主键、外键、唯一性约束和检查约束,以确保数据的一致性和有效性。 + +### 多用户支持和权限管理 + +MySQL允许多个用户同时访问数据库,并提供了灵活的权限管理功能。管理员可以控制每个用户对数据库和表的访问权限,以保护数据的安全性。 + +### 数据备份和恢复 + +MySQL支持数据备份和恢复操作,用户可以定期备份数据库,以防止数据丢失或损坏,并在需要时进行恢复。 + +### 多平台支持 + +MySQL可以在多种操作系统上运行,包括Windows、Linux、macOS等,使其适用于各种不同的开发和部署环境。 + +### 扩展性 + +MySQL具有良好的扩展性,支持分布式数据库架构,可以处理高负载的应用程序。 + +### 开源和社区支持 + +MySQL是开源软件,拥有强大的社区支持。用户可以从社区获取帮助、文档和各种插件来扩展MySQL的功能。 \ No newline at end of file diff --git a/apps/mysql/README_en.md b/apps/mysql/README_en.md new file mode 100644 index 00000000..19b4a8f2 --- /dev/null +++ b/apps/mysql/README_en.md @@ -0,0 +1,37 @@ +# MySQL + +MySQL is a popular open-source RDBMS (Relational Database Management System) that offers a rich set of features suitable for various application scenarios. + +## Main Features + +### Data Storage and Management + +MySQL allows users to create, store, and manage large amounts of data. It supports various data types, including integers, floating-point numbers, strings, dates, etc., to meet different data requirements. + +### Data Retrieval and Querying + +MySQL provides powerful query capabilities, allowing users to use SQL (Structured Query Language) to retrieve and filter data. Users can perform various complex query operations, including filtering, sorting, grouping, and joining data from multiple tables. + +### Data Integrity and Constraints + +MySQL supports data integrity and constraints, including primary keys, foreign keys, unique constraints, and check constraints, to ensure data consistency and validity. + +### Multi-User Support and Permission Management + +MySQL allows multiple users to access the database simultaneously and provides flexible permission management features. Administrators can control each user's access to databases and tables to protect data security. + +### Data Backup and Recovery + +MySQL supports data backup and recovery operations. Users can regularly back up the database to prevent data loss or corruption and restore it when needed. + +### Multi-Platform Support + +MySQL can run on various operating systems, including Windows, Linux, macOS, etc., making it suitable for different development and deployment environments. + +### Scalability + +MySQL has good scalability, supporting distributed database architectures and handling high-load applications. + +### Open Source and Community Support + +MySQL is open-source software with strong community support. Users can get help, documentation, and various plugins from the community to extend MySQL's functionality.