Docker在启动MariaDB时无法启动【InnoDB:无法在./ibdata1文件上设置O_DIRECT:OPEN:参数无效,但仍然继续。 在Linux上,tmpfs上的O_DIRECT已知会导致“参数无效”。】
以下是在Docker中解决MariaDB无法启动的错误的方法:
[Warning] InnoDB: Failed to set O_DIRECT on file ./ibdata1: OPEN: Invalid argument, continuing anyway. O_DIRECT is known to result in 'Invalid argument' on Linux on tmpfs
[ERROR] Plugin 'InnoDB' init function returned error.
mariadb_1
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
mariadb_1
[Note] Plugin 'FEEDBACK' is disabled.
mariadb_1
[ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
mariadb_1
[ERROR] Unknown/unsupported storage engine: InnoDB
mariadb_1
[ERROR] Aborting
通过修改docker-compose.yml文件来解决问题。
mariadb:
build: ./mariadb
volumes:
- ./mariadb/data:/var/lib/mysql
ports:
- 3306:3306
请用中文将以下内容进行改写,只需提供一种版本:
↓↓↓↓↓↓↓
mariadb:
build: ./mariadb
volumes:
- ./mariadb/data:/var/lib/mariadb #変更
ports:
- 3306:3306
通过将 /var/lib/mysql 更改为 /var/lib/mariadb,可以成功启动MariaDB。