add docker config files
This commit is contained in:
14
docker/mysql/init/init.sql
Normal file
14
docker/mysql/init/init.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
-- docker/mysql/init/init.sql
|
||||
-- 初始化数据库和用户
|
||||
CREATE DATABASE IF NOT EXISTS shop_mallnew CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
CREATE USER IF NOT EXISTS 'shop_mallnew'@'%' IDENTIFIED BY 'shop_mallnew';
|
||||
GRANT ALL PRIVILEGES ON shop_mallnew.* TO 'shop_mallnew'@'%';
|
||||
|
||||
CREATE DATABASE IF NOT EXISTS 5g CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
CREATE USER IF NOT EXISTS '5g'@'%' IDENTIFIED BY '123456';
|
||||
GRANT ALL PRIVILEGES ON 5g.* TO '5g'@'%';
|
||||
|
||||
-- 刷新权限
|
||||
FLUSH PRIVILEGES;
|
||||
|
||||
-- 你可以根据需要添加更多的初始化SQL语句
|
||||
27
docker/mysql/my.cnf
Normal file
27
docker/mysql/my.cnf
Normal file
@@ -0,0 +1,27 @@
|
||||
[mysqld]
|
||||
# 字符集设置
|
||||
character-set-server=utf8mb4
|
||||
collation-server=utf8mb4_unicode_ci
|
||||
|
||||
# 连接设置
|
||||
max_connections=100
|
||||
wait_timeout=28800
|
||||
interactive_timeout=28800
|
||||
|
||||
# 缓冲区设置
|
||||
innodb_buffer_pool_size=256M
|
||||
key_buffer_size=64M
|
||||
|
||||
# 日志设置
|
||||
slow_query_log=1
|
||||
slow_query_log_file=/var/lib/mysql/slow.log
|
||||
long_query_time=2
|
||||
|
||||
# 其他设置
|
||||
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
|
||||
|
||||
[client]
|
||||
default-character-set=utf8mb4
|
||||
|
||||
[mysql]
|
||||
default-character-set=utf8mb4
|
||||
6
docker/mysql/sources.list
Normal file
6
docker/mysql/sources.list
Normal file
@@ -0,0 +1,6 @@
|
||||
# deb http://snapshot.debian.org/archive/debian/20221114T000000Z bullseye main
|
||||
deb https://mirrors.aliyun.com/debian/ bullseye main
|
||||
# deb http://snapshot.debian.org/archive/debian-security/20221114T000000Z bullseye-security main
|
||||
deb https://mirrors.aliyun.com/debian-security/ bullseye-security main
|
||||
# deb http://snapshot.debian.org/archive/debian/20221114T000000Z bullseye-updates main
|
||||
deb https://mirrors.aliyun.com/debian/ bullseye-updates main
|
||||
Reference in New Issue
Block a user