[英]Docker on Windows gives error when trying to start mysql container
我是Docker的新手,現在嘗試創建我的第一個docker-compose文件。 到目前為止,Apache可以正常工作,但是我正在努力地與mysql斗爭。
這是我的docker-compose.yaml
version: '3'
services:
web:
build: .
ports:
- "8083:80"
volumes:
- ./public_html/:/usr/local/apache2/htdocs/
networks:
- appnet
db:
image: mysql
volumes:
- db-data:/var/lib/mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
networks:
- appnet
adminer:
image: adminer
restart: always
ports:
- 8080:8080
volumes:
db-data:
networks:
appnet:
錯誤是: [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
[ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
我已經嘗試過完全刪除該卷或在末尾添加了/ data。 但這總是給我同樣的錯誤。 谷歌也沒有給我任何好的提示。
有人有主意嗎?
我現在想通了。 我在Windows計算機上運行Docker,因此我必須在Docker App上重置憑據並再次輸入。 現在可以了。 希望對其他人也有幫助。 在適用於Windows的Docker上,似乎無法按預期工作時,重置憑據很有意義。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.