简体   繁体   English

如何恢复崩溃的 MySQL Docker 容器

[英]How can I restore a MySQL Docker container that has crashed

After updating, my WordPress stopped connecting to the MySQL DB on docker.更新后,我的 WordPress 停止连接到 docker 上的 MySQL 数据库。

So as of now, I start Docker, see the following logs:所以截至目前,我启动 Docker,查看以下日志:

2022-02-14 02:28:07+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.28-1debian10 started.

2022-02-14 02:28:07+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'

2022-02-14 02:28:07+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.28-1debian10 started.

2022-02-14T02:28:08.102455Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.

2022-02-14T02:28:08.102491Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.28) starting as process 1

2022-02-14T02:28:08.144825Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.

2022-02-14T02:28:08.625666Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.

2022-02-14T02:28:58.896407Z 1 [ERROR] [MY-013178] [Server] Execution of server-side SQL statement 'DROP SCHEMA IF EXISTS dd_upgrade_garbage_80028' failed with error code = 3664, error message = 'Failed to delete SDI 'dd_upgrade_garbage_80028.columns' in tablespace 'mysql'.'.

2022-02-14T02:28:58.905477Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.

2022-02-14T02:28:58.905864Z 0 [ERROR] [MY-010119] [Server] Aborting

2022-02-14T02:28:59.332262Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.28)  MySQL Community Server - GPL.

Now as its a docker with a volume attached to /var/lib/mysql现在作为它的 docker 有一个附加到 /var/lib/mysql 的卷

I have all the data files, but as the server keeps on restarting, I have a very small window to run any commands on docker.我有所有的数据文件,但随着服务器不断重启,我有一个非常小的 window 可以在 docker 上运行任何命令。

This problem may occur if the MySQL container stops abnormally MySQL容器异常停止可能会出现这个问题

First, make a backup of the data directory of MySQL container首先备份MySQL容器的数据目录

You can try to upgrade the MySQL container version.可以尝试升级MySQL容器版本。 Can you fix this problem你能解决这个问题吗

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

相关问题 如何在 Docker 容器中恢复 mysql 数据库转储 - How to restore a mysql database dump in a Docker container 如何在 Mysql docker 容器中设置 MYSQL_PS1 - How can I set MYSQL_PS1 in Mysql docker container 如何将 MySQL 转储从主机恢复到 Docker 容器 - How to restore MySQL dump from host to Docker container 如何在 Docker 容器中使用架构初始化 MySQL 数据库? - How can I initialize a MySQL database with schema in a Docker container? 如何通过 MySQL 转储文件从主机恢复数据到 Docker 容器。 Windows - How to restore Data from a MySQL dump file, from host to Docker container via. Windows 容器初始化后如何连接到docker-compose mysql? - How to connect to docker-compose mysql after container has initilized? 如何在不使用终端传递的情况下从 docker 容器中的文件恢复 MySQL 转储 - How to restore MySQL dump from file in docker container not using pass in terminal 将 sql 转储恢复到正在运行的 mysql/mariadb docker 容器中 - Restore sql dump into running mysql/mariadb docker container Docker-如何在容器上运行.sql文件来启动mysql数据库? - Docker - How can I initiate mysql database with a .sql file running on a container? 我可以在 ZB76E98AF9AAA680979BF5A65B2 上使用 docker 组合 mysql + spring 引导容器吗? - Can I use docker compose mysql + spring boot container on kubernetes?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM