使用现有的 InnoDB 数据库启动 mySQL docker 容器时启动失败

使用现有的 InnoDB 数据库启动 mySQL docker 容器时启动失败

我正在测试启动具有现有 InnoDB 目录的 mySQL Docker 容器的工作流程。这几乎是从远程服务器 rsync 的。

我尝试了 MariaDB,结果如下:

db_mariaDB | 2020-12-15 13:01:35 0 [ERROR] InnoDB: redo log file './ib_logfile0' exists. Creating system tablespace with existing redo log file is not recommended. Please delete redo log file before creating new system tablespace.
db_mariaDB | 2020-12-15 13:01:35 0 [ERROR] InnoDB: Database creation was aborted with error Generic error. You may need to delete the ibdata1 file before trying to start up again.
db_mariaDB | 2020-12-15 13:01:35 0 [ERROR] Plugin 'InnoDB' init function returned error.
db_mariaDB | 2020-12-15 13:01:35 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
db_mariaDB | 2020-12-15 13:01:35 0 [ERROR] Unknown/unsupported storage engine: InnoDB
db_mariaDB | 2020-12-15 13:01:35 0 [ERROR] Aborting

...mySQL 结果如下:

db_mysql   | 2020-12-15 13:08:51+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
db_mysql   | 2020-12-15 13:08:51+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.
db_mysql   | 2020-12-15 13:08:52+00:00 [Note] [Entrypoint]: Initializing database files
db_mysql   | 2020-12-15T13:08:52.068011Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.22) initializing of server in progress as process 43
db_mysql   | 2020-12-15T13:08:52.070879Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
db_mysql   | 2020-12-15T13:08:52.070887Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
db_mysql   | 2020-12-15T13:08:52.071764Z 0 [ERROR] [MY-010119] [Server] Aborting

关键是我无法转储数据库,然后将其放入目录中并让容器进行一些初始化操作,因为此工具要使用的数据库接近 0.5TB。初始化容器需要几个世纪的时间。

关于如何使其工作有什么提示吗?

相关内容