feat: init
This commit is contained in:
26
docker-compose-mysql.yml
Normal file
26
docker-compose-mysql.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
mysql:
|
||||
container_name: my-mysql
|
||||
image: mysql:8.0
|
||||
restart: always
|
||||
ports:
|
||||
- "3306:3306"
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: root123 # root 用户密码
|
||||
MYSQL_DATABASE: xiaozhi # 初始化数据库
|
||||
MYSQL_USER: xiaozhi # 初始化用户
|
||||
MYSQL_PASSWORD: 123456 # 用户密码
|
||||
TZ: Asia/Shanghai # 时区
|
||||
volumes:
|
||||
- ./mysql/data:/var/lib/mysql # 持久化数据
|
||||
- ./mysql/init:/docker-entrypoint-initdb.d # 初始化脚本
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
command:
|
||||
[
|
||||
"--character-set-server=utf8mb4",
|
||||
"--collation-server=utf8mb4_general_ci",
|
||||
"--lower_case_table_names=1",
|
||||
"--default-authentication-plugin=mysql_native_password"
|
||||
]
|
||||
Reference in New Issue
Block a user