From d72a2221e50a530c79a778dfeed634468ae1ac83 Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Sat, 28 Feb 2026 23:55:05 +0800 Subject: [PATCH] fix maxwell.md --- maxwell.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 maxwell.md diff --git a/maxwell.md b/maxwell.md new file mode 100644 index 0000000..c04e344 --- /dev/null +++ b/maxwell.md @@ -0,0 +1,48 @@ +## maxwell配置 + +## docker-compose.yml配置 +```yaml + +services: + maxwell: + image: docker.1ms.run/zendesk/maxwell:latest + container_name: maxwell + network_mode: "host" + + restart: always + entrypoint: ["bin/maxwell"] + + command: + - --host=127.0.0.1 + - --port=3306 + - --user=punchnetuser + - --password=punchnet@J1c8WGu + - --producer=redis + - --redis_host=127.0.0.1 + - --redis_port=16379 + - --redis_type=stream + - --redis_stream=maxwell_stream + - --log_level=info +``` + +## mysql权限配置 + +```sql + +# 创建maxwell依赖的数据库 + +CREATE DATABASE maxwell; +GRANT ALL ON maxwell.* TO 'punchnetuser'@'%'; + +-- 1️⃣ 允许读取数据 +GRANT SELECT ON *.* TO 'punchnetuser'@'%'; + +-- 2️⃣ 允许复制权限(关键) +GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'punchnetuser'@'%'; + +-- 3️⃣ 如果还需要创建 maxwell 库 +GRANT ALL ON maxwell.* TO 'punchnetuser'@'%'; + +FLUSH PRIVILEGES; + +``` \ No newline at end of file