You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows 10 Pro下Docker Compose部署MariaDB 5.5.57启动失败求助

解决MariaDB 5.5.57容器启动时InnoDB页面配置错误问题

Hey there, let's tackle this InnoDB error you're hitting with your MariaDB 5.5.57 container on Windows 10 Pro. I've seen this exact issue a few times before, and it's usually tied to incompatible default InnoDB settings or leftover data from previous runs.

First, let's recap your setup and the error you're seeing:

Your Docker Compose Configuration

database:
  image: mariadb:5.5.57
  ports:
    - "3306:3306"
  volumes:
    - ./sql/:/docker-entrypoint-initdb.d/
    - ./data:/var/lib/mysql
  environment:
    - MYSQL_ROOT_PASSWORD=root
    - MYSQL_USER=rootUsr
    - MYSQL_PASSWORD=rootPwd
    - MYSQL_DATABASE=root_db

The Error You Encountered

database_1 | InnoDB: 0 pages (rounded down to MB) than specified in the .cnf file:
database_1 | InnoDB: initial 640 pages, max ...


Fixes to Try (Ordered by Ease of Implementation)

1. Override InnoDB Settings Directly in Docker Compose

The root issue here is that MariaDB 5.5.57's default InnoDB buffer pool and log file settings don't play nicely with Windows' Docker volume filesystem. We can explicitly set smaller, compatible values to bypass the page calculation mismatch.

Modify your docker-compose.yml to add a command section that overrides these settings:

database:
  image: mariadb:5.5.57
  ports:
    - "3306:3306"
  volumes:
    - ./sql/:/docker-entrypoint-initdb.d/
    - ./data:/var/lib/mysql
  environment:
    - MYSQL_ROOT_PASSWORD=root
    - MYSQL_USER=rootUsr
    - MYSQL_PASSWORD=rootPwd
    - MYSQL_DATABASE=root_db
  # Add this command section to override InnoDB settings
  command: --innodb_buffer_pool_size=64M --innodb_log_file_size=32M --innodb_log_buffer_size=8M

2. Clean Up Leftover Container Data

If you've started this container before, the ./data volume might have old InnoDB log files that conflict with the new settings. Let's wipe them clean:

  • First, stop and remove the existing containers and volumes:
    docker-compose down -v
    
  • Delete the local ./data directory manually (just to be safe, since Windows sometimes holds file locks):
    Remove-Item -Recurse -Force ./data
    
  • Now restart the container:
    docker-compose up
    

3. Verify Windows File Permissions

Docker on Windows often runs into permission issues with mounted volumes. Make sure the ./sql and ./data directories have the right permissions:

  • Right-click the directory → Properties → Security tab
  • Add Authenticated Users to the permissions list, and grant them Read & Write access
  • Click Apply and restart the Docker container

内容的提问来源于stack exchange,提问作者Damien

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 03:36:13