gpt4 book ai didi

docker - Docker mariadb无法启动

转载 作者:行者123 更新时间:2023-12-02 19:18:34 25 4
gpt4 key购买 nike

我的MariaDB容器无法启动,我也不知道为什么。
这是我的docker-compose.yml:

version:  '3.7'
services:
mariadb:
image: ${MARIADB_VERSION}
restart: on-failure
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
ports:
- ${PORTS_MARIADB}
volumes:
- './db/:/var/lib/mysql'
user: 1000:1000

之后,我运行了以下命令:
docker-compose build
docker-compose up -d

但是我的MariaDB容器不想启动。
有容器的日志:
2020-05-12 20:33:35+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.4.12+maria~bionic started.
2020-05-12 20:33:35+00:00 [Note] [Entrypoint]: Initializing database files
2020-05-12 20:33:36 0 [ERROR] InnoDB: The Auto-extending innodb_system data file './ibdata1' is of a different size 0 pages than specified in the .cnf file: initial 768 pages, max 0 (relevant if non-zero) pages!
2020-05-12 20:33:36 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2020-05-12 20:33:36 0 [ERROR] Plugin 'InnoDB' init function returned error.
2020-05-12 20:33:36 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2020-05-12 20:33:36 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2020-05-12 20:33:36 0 [ERROR] Aborting

Installation of system tables failed! Examine the logs in
/var/lib/mysql/ for more information.

The problem could be conflicting information in an external
my.cnf files. You can ignore these by doing:

shell> /usr/bin/mysql_install_db --defaults-file=~/.my.cnf

You can also try to start the mysqld daemon with:

shell> /usr/sbin/mysqld --skip-grant-tables --general-log &

and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:

shell> /usr/bin/mysql -u root mysql
mysql> show tables;

Try 'mysqld --help' if you have problems with paths. Using
--general-log gives you a log in /var/lib/mysql/ that may be helpful.

The latest information about mysql_install_db is available at
https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
You can find the latest source at https://downloads.mariadb.org and
the maria-discuss email list at https://launchpad.net/~maria-discuss

Please check all of the above before submitting a bug report
at http://mariadb.org/jira

为什么以及如何解决这个问题?

最好的祝福 :)

最佳答案

我认为您在Windows上使用Docker Desktop?如果是这样,那就是已知问题。
您无法在Windows的mariadb上装载主机卷。有关更多详细信息,您可以检查github问题:https://github.com/docker-library/mariadb/issues/152

解决方法是使用由docker管理的命名卷:

version:  '3.7'
services:
mariadb:
image: ${MARIADB_VERSION}
restart: on-failure
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
ports:
- ${PORTS_MARIADB}
volumes:
- mariadb-data:/var/lib/mysql

关于docker - Docker mariadb无法启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61761460/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com