繁体   English   中英

Laradock MySQL 容器退出(0) - 服务器('2')和数据字典('0')的不同lower_case_table_names设置

[英]Laradock MySQL container exits(0) - Different lower_case_table_names settings for server ('2') and data dictionary ('0')

在 Mac 上安装 Docker 和 Laradock 后,我尝试使用以下命令启动 docker 容器:

docker-compose up -d nginx mysql phpmyadmin

我得到输出:

Starting laradock_mysql_1            ... done
Starting laradock_docker-in-docker_1 ... done
Starting laradock_phpmyadmin_1       ... done
Starting laradock_workspace_1        ... done
Starting laradock_php-fpm_1          ... done
Starting laradock_nginx_1            ... done

看起来不错,但由于某种原因 MySQL 崩溃了。 当我尝试再次启动容器时,我收到以下消息:

mysql_1                | 2020-10-01T10:19:52.124915Z 1 [Warning] [MY-012579] [InnoDB] fallocate(25, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 16384) returned errno: 22
mysql_1                | 2020-10-01T10:19:52.143672Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
mysql_1                | 2020-10-01T10:19:52.159801Z 1 [ERROR] [MY-011087] [Server] Different lower_case_table_names settings for server ('2') and data dictionary ('0').
mysql_1                | 2020-10-01T10:19:52.160778Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
mysql_1                | 2020-10-01T10:19:52.161607Z 0 [ERROR] [MY-010119] [Server] Aborting
mysql_1                | 2020-10-01T10:19:52.795909Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.21)  MySQL Community Server - GPL.

我尝试将"command: --lower_case_table_names=0"到我的"command: --lower_case_table_names=0" -compose 文件中,但这似乎没有帮助。

MySQL 崩溃:

mysql_1                | 2020-10-01 10:21:28+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config
mysql_1                |        command was: mysqld --lower_case_table_names=0 --verbose --help
mysql_1                |        2020-10-01T10:21:28.547104Z 0 [ERROR] [MY-010158] [Server] The server option 'lower_case_table_names' is configured to use case sensitive table names but the data directory is on a case-insensitive file system which is an unsupported combination. Please consider either using a case sensitive file system for your data directory or switching to a case-insensitive table name mode.
mysql_1                | 2020-10-01T10:21:28.549273Z 0 [ERROR] [MY-010119] [Server] Aborting

我的解决方案:

cmd

fsutil file setCaseSensitiveInfo "C:\Users\XXXXX\.laradock\data\mysql"

这将在 Windows 10 中将数据字典的 lower_case_table_names 从 ('0') 更改为 ('2')。XXXXX - 您在 Windows 10 中的用户名。

然后:

docker-compose up mysql

这很可能是由 docker 更新到 2.4 引起的。 看:

docker 更新后,Mysql 未在 MacOS 上的 docker 容器中启动

madx 提供的解决方案有效。 如果收到错误消息说目标文件夹不是空的,因此不能使文件夹区分大小写,只需 1.将文件和子文件夹移出目标文件夹; 2.使目标文件夹区分大小写; 3.将文件和子文件夹移回目标文件夹。 一切都会好的。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM