feat:同步上游MySQL

This commit is contained in:
okxlin 2024-12-15 17:53:53 +08:00
parent 12b91d61e3
commit 7813ddf875
9 changed files with 131 additions and 15 deletions

View File

@ -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

View File

@ -1,7 +1,6 @@
services: services:
mysql: mysql:
image: mysql:8.4.0 image: mysql:8.0.40
container_name: ${CONTAINER_NAME} container_name: ${CONTAINER_NAME}
restart: always restart: always
environment: environment:

View File

@ -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/

View File

@ -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

View File

@ -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

View File

@ -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. MySQL允许用户创建、存储和管理大量的数据。它支持多种数据类型包括整数、浮点数、字符串、日期等以满足不同类型的数据需求。
For license and attribution notices for these materials,
please refer to the LICENSE file.
For further information on MySQL or additional documentation, visit ### 数据检索和查询
http://dev.mysql.com/doc/
For additional downloads and the source of MySQL, visit MySQL提供强大的查询功能允许用户使用SQLStructured Query Language语言来检索和过滤数据。用户可以执行各种复杂的查询操作包括筛选、排序、分组和连接多个表格中的数据。
http://dev.mysql.com/downloads/
MySQL is brought to you by the MySQL team at Oracle. ### 数据完整性和约束
MySQL支持数据完整性和约束包括主键、外键、唯一性约束和检查约束以确保数据的一致性和有效性。
### 多用户支持和权限管理
MySQL允许多个用户同时访问数据库并提供了灵活的权限管理功能。管理员可以控制每个用户对数据库和表的访问权限以保护数据的安全性。
### 数据备份和恢复
MySQL支持数据备份和恢复操作用户可以定期备份数据库以防止数据丢失或损坏并在需要时进行恢复。
### 多平台支持
MySQL可以在多种操作系统上运行包括Windows、Linux、macOS等使其适用于各种不同的开发和部署环境。
### 扩展性
MySQL具有良好的扩展性支持分布式数据库架构可以处理高负载的应用程序。
### 开源和社区支持
MySQL是开源软件拥有强大的社区支持。用户可以从社区获取帮助、文档和各种插件来扩展MySQL的功能。

37
apps/mysql/README_en.md Normal file
View File

@ -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.