mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-12 00:16:37 +08:00
feat: 增加mysql8.0版本
This commit is contained in:
parent
4830839c91
commit
c6219707ec
9 changed files with 207 additions and 16 deletions
|
@ -1,6 +0,0 @@
|
||||||
TZ=Asia/Shanghai
|
|
||||||
DATABASE=db
|
|
||||||
USER=mysql
|
|
||||||
PASSWORD=1qaz@WSX
|
|
||||||
ROOT_PASSWORD=1panel@mysql
|
|
||||||
PORT=3306
|
|
20
apps/mysql/8.0.30/README.md
Normal file
20
apps/mysql/8.0.30/README.md
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
|
||||||
|
|
||||||
|
This is a release of MySQL, an SQL database server.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
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 is brought to you by the MySQL team at Oracle.
|
83
apps/mysql/8.0.30/conf/my.cnf
Normal file
83
apps/mysql/8.0.30/conf/my.cnf
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
|
||||||
|
[client]
|
||||||
|
port = 3306
|
||||||
|
socket = /var/run/mysqld/mysqld.sock
|
||||||
|
|
||||||
|
[mysqld_safe]
|
||||||
|
socket = /var/run/mysqld/mysqld.sock
|
||||||
|
nice = 0
|
||||||
|
|
||||||
|
[mysqld]
|
||||||
|
user = mysql
|
||||||
|
pid-file = /var/run/mysqld/mysqld.pid
|
||||||
|
socket = /var/run/mysqld/mysqld.sock
|
||||||
|
port = 3306
|
||||||
|
basedir = /usr
|
||||||
|
datadir = /var/lib/mysql
|
||||||
|
tmpdir = /tmp
|
||||||
|
lc-messages-dir = /usr/share/mysql
|
||||||
|
skip-external-locking
|
||||||
|
skip-character-set-client-handshake
|
||||||
|
default-storage-engine = InnoDB
|
||||||
|
character-set-server = utf8
|
||||||
|
transaction-isolation = READ-COMMITTED
|
||||||
|
|
||||||
|
|
||||||
|
bind-address = 127.0.0.1
|
||||||
|
key_buffer = 16M
|
||||||
|
max_allowed_packet = 16M
|
||||||
|
thread_stack = 192K
|
||||||
|
thread_cache_size = 16
|
||||||
|
myisam-recover = BACKUP
|
||||||
|
max_connections = 300
|
||||||
|
table_open_cache = 64
|
||||||
|
thread_concurrency = 10
|
||||||
|
table_open_cache = 32
|
||||||
|
thread_concurrency = 4
|
||||||
|
|
||||||
|
query_cache_type = 1
|
||||||
|
query_cache_limit = 1M
|
||||||
|
query_cache_size = 8M
|
||||||
|
general_log_file = /var/log/mysql/mysql.log
|
||||||
|
#general_log = 1
|
||||||
|
log_error = /var/log/mysql/error.log
|
||||||
|
|
||||||
|
slow_query_log = 1
|
||||||
|
slow_query_log_file = /var/log/mysql/mysql-slow.log
|
||||||
|
long_query_time = 1
|
||||||
|
#log-queries-not-using-indexes
|
||||||
|
|
||||||
|
|
||||||
|
#server-id = 1
|
||||||
|
#log_bin = /var/log/mysql/mysql-bin.log
|
||||||
|
expire_logs_days = 14
|
||||||
|
max_binlog_size = 1G
|
||||||
|
#binlog_do_db = include_database_name
|
||||||
|
#binlog_ignore_db = include_database_name
|
||||||
|
|
||||||
|
|
||||||
|
# ssl-ca=/etc/mysql/cacert.pem
|
||||||
|
# ssl-cert=/etc/mysql/server-cert.pem
|
||||||
|
# ssl-key=/etc/mysql/server-key.pem
|
||||||
|
innodb_data_file_path = ibdata1:128M:autoextend
|
||||||
|
innodb_file_per_table = 1
|
||||||
|
skip-innodb_doublewrite
|
||||||
|
innodb_additional_mem_pool_size = 12M
|
||||||
|
innodb_buffer_pool_size = 256M
|
||||||
|
innodb_log_buffer_size = 8M
|
||||||
|
innodb_log_file_size = 8M
|
||||||
|
innodb_flush_log_at_trx_commit = 0
|
||||||
|
innodb_flush_method = O_DIRECT
|
||||||
|
innodb_support_xa = OFF
|
||||||
|
|
||||||
|
|
||||||
|
[mysqldump]
|
||||||
|
quick
|
||||||
|
quote-names
|
||||||
|
max_allowed_packet = 16M
|
||||||
|
|
||||||
|
[mysql]
|
||||||
|
#no-auto-rehash # faster start of mysql but no tab completition
|
||||||
|
|
||||||
|
[isamchk]
|
||||||
|
key_buffer = 16M
|
23
apps/mysql/8.0.30/docker-compose.yml
Normal file
23
apps/mysql/8.0.30/docker-compose.yml
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
mysql8.0:
|
||||||
|
image: mysql:8.0.30
|
||||||
|
container_name: ${CONTAINER_NAME}
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
TZ: ${TZ}
|
||||||
|
MYSQL_DATABASE: ${DATABASE}
|
||||||
|
MYSQL_USER: ${USER}
|
||||||
|
MYSQL_PASSWORD: ${PASSWORD}
|
||||||
|
MYSQL_ROOT_PASSWORD: ${ROOT_PASSWORD}
|
||||||
|
ports:
|
||||||
|
- ${PORT}:3306
|
||||||
|
volumes:
|
||||||
|
- ./data/:/var/lib/mysql
|
||||||
|
- ./conf/my.cnf:/etc/mysql/my.cnf
|
||||||
|
command:
|
||||||
|
--character-set-server=utf8mb4
|
||||||
|
--collation-server=utf8mb4_general_ci
|
||||||
|
--explicit_defaults_for_timestamp=true
|
||||||
|
--lower_case_table_names=1
|
52
apps/mysql/8.0.30/params.json
Normal file
52
apps/mysql/8.0.30/params.json
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
{
|
||||||
|
"formFields": [
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"labelZh": "时区",
|
||||||
|
"labelEn": "TimeZone",
|
||||||
|
"required": true,
|
||||||
|
"default": "Asia/Shanghai",
|
||||||
|
"envKey": "TZ"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"labelZh": "数据库",
|
||||||
|
"labelEn": "Database",
|
||||||
|
"required": true,
|
||||||
|
"default": "db",
|
||||||
|
"envKey": "DATABASE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"labelZh": "普通用户",
|
||||||
|
"labelEn": "User",
|
||||||
|
"required": true,
|
||||||
|
"default": "mysql",
|
||||||
|
"envKey": "USER"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"labelZh": "普通用户密码",
|
||||||
|
"labelEn": "Password",
|
||||||
|
"required": true,
|
||||||
|
"default": "1qaz@WSX",
|
||||||
|
"envKey": "PASSWORD"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"labelZh": "Root用户密码",
|
||||||
|
"labelEn": "RootPassword",
|
||||||
|
"required": true,
|
||||||
|
"default": "1panel@mysql",
|
||||||
|
"envKey": "ROOT_PASSWORD"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "number",
|
||||||
|
"labelZh": "端口",
|
||||||
|
"labelEn": "Port",
|
||||||
|
"required": true,
|
||||||
|
"default": 3306,
|
||||||
|
"envKey": "PORT"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -17,7 +17,7 @@ func (a AppInstallRepo) GetBy(opts ...DBOption) ([]model.AppInstall, error) {
|
||||||
return install, err
|
return install, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a AppInstallRepo) Create(install model.AppInstall) error {
|
func (a AppInstallRepo) Create(install *model.AppInstall) error {
|
||||||
db := global.DB.Model(&model.AppInstall{})
|
db := global.DB.Model(&model.AppInstall{})
|
||||||
return db.Create(&install).Error
|
return db.Create(&install).Error
|
||||||
}
|
}
|
||||||
|
|
|
@ -242,7 +242,7 @@ func (a AppService) Install(name string, appDetailId uint, params map[string]int
|
||||||
if err := godotenv.Write(envParams, envPath); err != nil {
|
if err := godotenv.Write(envParams, envPath); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := appInstallRepo.Create(appInstall); err != nil {
|
if err := appInstallRepo.Create(&appInstall); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
go upApp(composeFilePath, appInstall)
|
go upApp(composeFilePath, appInstall)
|
||||||
|
|
|
@ -61,6 +61,7 @@ export default {
|
||||||
createSuccess: 'Create Success',
|
createSuccess: 'Create Success',
|
||||||
updateSuccess: 'Update Success',
|
updateSuccess: 'Update Success',
|
||||||
uploadSuccess: 'Update Success',
|
uploadSuccess: 'Update Success',
|
||||||
|
operate: 'Operate',
|
||||||
},
|
},
|
||||||
login: {
|
login: {
|
||||||
captchaHelper: 'Please enter the verification code',
|
captchaHelper: 'Please enter the verification code',
|
||||||
|
@ -397,8 +398,21 @@ export default {
|
||||||
description: 'A modern Linux panel tool',
|
description: 'A modern Linux panel tool',
|
||||||
},
|
},
|
||||||
app: {
|
app: {
|
||||||
installed: 'Installed',
|
installed: 'installed',
|
||||||
all: 'All',
|
all: 'all',
|
||||||
version: 'Version',
|
version: 'version',
|
||||||
|
detail: 'detail',
|
||||||
|
install: 'install',
|
||||||
|
author: 'author',
|
||||||
|
source: 'source',
|
||||||
|
sync: 'sync',
|
||||||
|
appName: 'App Name',
|
||||||
|
status: 'status',
|
||||||
|
container: 'container',
|
||||||
|
restart: 'restart',
|
||||||
|
up: 'start',
|
||||||
|
down: 'stop',
|
||||||
|
name: 'name',
|
||||||
|
description: 'description',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<el-dialog v-model="open" :title="$t('app.install')" width="30%">
|
<el-dialog v-model="open" :title="$t('app.install')" width="30%">
|
||||||
<el-form ref="paramForm" label-position="left" :model="form" label-width="150px" :rules="rules">
|
<el-form ref="paramForm" label-position="left" :model="form" label-width="150px" :rules="rules">
|
||||||
<el-form-item :label="$t('app.name')" prop="name">
|
<el-form-item :label="$t('app.name')" prop="NAME">
|
||||||
<el-input v-model="req.name"></el-input>
|
<el-input v-model="form['NAME']"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div v-for="(f, index) in installData.params?.formFields" :key="index">
|
<div v-for="(f, index) in installData.params?.formFields" :key="index">
|
||||||
<el-form-item :label="f.labelZh" :prop="f.envKey">
|
<el-form-item :label="f.labelZh" :prop="f.envKey">
|
||||||
|
@ -19,6 +19,9 @@
|
||||||
></el-input>
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- <el-form-item :label="$t('app.description')">
|
||||||
|
<el-input v-model="req.name"></el-input>
|
||||||
|
</el-form-item> -->
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
|
@ -47,8 +50,9 @@ const installData = ref<InstallRrops>({
|
||||||
});
|
});
|
||||||
let open = ref(false);
|
let open = ref(false);
|
||||||
let form = reactive<{ [key: string]: any }>({});
|
let form = reactive<{ [key: string]: any }>({});
|
||||||
|
|
||||||
let rules = reactive<FormRules>({
|
let rules = reactive<FormRules>({
|
||||||
name: [Rules.requiredInput],
|
NAME: [Rules.requiredInput],
|
||||||
});
|
});
|
||||||
let loading = false;
|
let loading = false;
|
||||||
const paramForm = ref<FormInstance>();
|
const paramForm = ref<FormInstance>();
|
||||||
|
@ -88,8 +92,9 @@ const submit = async (formEl: FormInstance | undefined) => {
|
||||||
}
|
}
|
||||||
req.appDetailId = installData.value.appDetailId;
|
req.appDetailId = installData.value.appDetailId;
|
||||||
req.params = form;
|
req.params = form;
|
||||||
InstallApp(req).then((res) => {
|
req.name = form['NAME'];
|
||||||
console.log(res);
|
InstallApp(req).then(() => {
|
||||||
|
handleClose();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue