error.log里的报错如下 2024-12-04T13:34:06.701974+08:00 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting. 2024-12-04T13:34:06.702047+08:00 0 [ERROR] [MY-013236] [Server] The designated data directory /data/GreatSQL/ is unusable. You can remove all files that the server added to it. 我看了一下这个报错就是data/greatsql被占用了,但是cnf是基本是用的原版,而且宿主机没有到容器data/GreatSQL的映射(映射关系里前面的greatsql是宿主机上的文件夹) docker compose如下 version: '3' services: greatsql: image: dptech/greatsql:8.0.36-amd64 container_name: greatsql network_mode: host restart: always privileged: true deploy: resources: limits: memory: 128M env_file: - ../../data/greatsql/config/greatsql.env ports: - "3306:3306" # 将主机的 3306 端口映射到容器的 3306 端口 volumes: - ../../data/greatsql/logs:/var/log - ../../data/greatsql/logs/error.log:/error.log - ../../data/greatsql/config/my.cnf:/etc/my.cnf - ../../data/greatsql/config/my.client.cnf:/etc/my.client.cnf - ../../data/greatsql/sql:/opt/sql - ../../data/greatsql/sql_update:/opt/sql_update - ../../data/greatsql/init:/docker-entrypoint-initdb.d/ - ../../data/greatsql/sh/greatsql-init.sh:/greatsql-init.sh cnf如下 [client] socket = /data/GreatSQL/mysql.sock [mysql] loose-skip-binary-as-hex prompt = "(\\D)[\\u@GreatSQL][\\d]> " no-auto-rehash [mysqld] user = mysql port = 3306 server_id = 1 basedir = /usr/ datadir = /data/GreatSQL socket = /data/GreatSQL/mysql.sock pid-file = mysql.pid character-set-server = UTF8MB4 skip_name_resolve = ON default_time_zone = "+8:00" bind_address = "0.0.0.0" secure_file_priv = /data/GreatSQL lower_case_table_names = 0 # Logs log_timestamps = SYSTEM log_error = error.log log_error_verbosity = 3 slow_query_log = ON log_slow_extra = ON slow_query_log_file = slow.log |
yejr
2024-12-4 16:28:14
| ||
Jnu2021
2024-12-4 17:00:58
| ||
yejr
2024-12-4 17:59:38
| ||
Jnu2021
2024-12-4 21:18:31
| ||
KAiTO
2024-12-5 09:57:48
| ||
合作电话:010-64087828
社区邮箱:greatsql@greatdb.com