Windows 10 Pro下Docker Compose部署MariaDB 5.5.57启动失败求助
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
./datadirectory 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 Usersto the permissions list, and grant them Read & Write access - Click Apply and restart the Docker container
内容的提问来源于stack exchange,提问作者Damien

