![](/img/trans.png)
[英]docker-compose volume question and error --initialize specified but the data directory has files in it. Aborting
[英]How to resolve --initialize specified but the data directory has files in it. on laradock mysql container
我正在使用 laradock。 當我使用docker-compose up mysql
出現此錯誤。
mysql_1 | Initializing database
mysql_1 | 2018-04-22T10:41:01.362165Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
mysql_1 | 2018-04-22T10:41:01.362585Z 0 [ERROR] Aborting
mysql_1 |
laradock_mysql_1 exited with code 1
我試圖像這樣在 laradock/mysql/Dockerfile 上添加這個設置
ARG MYSQL_VERSION=latest
FROM mysql:${MYSQL_VERSION}
LABEL maintainer="Mahmoud Zalt <mahmoud@zalt.me>"
#####################################
# Set Timezone
#####################################
ARG TZ=UTC
ENV TZ ${TZ}
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN chown -R mysql:root /var/lib/mysql/
COPY my.cnf /etc/mysql/conf.d/my.cnf
CMD ["mysqld --ignore-db-dir=lost+found"]
EXPOSE 3306
但是,我仍然遇到上述錯誤。 你對這個解決方案有什么想法嗎?
謝謝,
我有一個類似的問題。 為了解決它,你必須
C:\\Program Files\\MySQL\\MySQL Server 5.7
data
的文件夾。 將其重命名為data1
。mysqld --initialize-insecure
。MySQL57
。MySQL
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.