用Docker Compose搭建WordPress时出现Failed to initialize DD Storage Engine、Dictionary initialization failed

问题概述:用Docker Compose搭建WordPress时出现Failed to initialize DD Storage Engine、Data Dictionary initialization failed.的错误

1、错误信息

截图:

用Docker Compose搭建WordPress时出现Failed to initialize DD Storage Engine、Dictionary initialization failed插图

my_wordpress-db-1 | 2022-09-25 06:42:54+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.27-1debian10 started. my_wordpress-db-1 | 2022-09-25 06:42:54+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql' my_wordpress-db-1 | 2022-09-25 06:42:54+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.27-1debian10 started. my_wordpress-db-1 | 2022-09-25T06:42:56.001990Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead. my_wordpress-db-1 | 2022-09-25T06:42:56.002040Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.27) starting as process 1 my_wordpress-db-1 | 2022-09-25T06:42:56.044303Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. my_wordpress-db-1 | 2022-09-25T06:42:56.389295Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create log files because data files are corrupt or the database was not shut down cleanly after creating the data files. my_wordpress-db-1 | 2022-09-25T06:42:56.389374Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. my_wordpress-wordpress-1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.19.0.3. Set the 'ServerName' directive globally to suppress this message my_wordpress-wordpress-1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.19.0.3. Set the 'ServerName' directive globally to suppress this message my_wordpress-wordpress-1 | [Sun Sep 25 06:42:56.717507 2022] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.51 (Debian) PHP/7.4.27 configured -- resuming normal operations my_wordpress-wordpress-1 | [Sun Sep 25 06:42:56.717599 2022] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND' my_wordpress-db-1 | 2022-09-25T06:42:56.824291Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine my_wordpress-db-1 | 2022-09-25T06:42:56.825425Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. my_wordpress-db-1 | 2022-09-25T06:42:56.825627Z 0 [ERROR] [MY-010119] [Server] Aborting my_wordpress-db-1 | 2022-09-25T06:42:56.826573Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.27) MySQL Community Server - GPL. 

2、原因

错误发生原因暂时不清楚,可能是mysql镜像、容器有多个,导致冲突了,有见解的同学可以在评论区帮忙解惑一下,谢谢

3、解决办法

(1)把所有的关于mysql的镜像、容器全部删除

(2)用以下命令查找所有关于mysql的文件,然后全部删除

find / -name mysql

(3)不要使用官方的yml,用以下我修改过的yml

services: db: image: mysql:latest command: --default-authentication-plugin=mysql_native_password volumes: - /home/mysql/data:/var/lib/mysql restart: always environment: - MYSQL_ROOT_PASSWORD=somewordpress - MYSQL_DATABASE=wordpress - MYSQL_USER=wordpress - MYSQL_PASSWORD=wordpress expose: - 3306 - 33060 wordpress: image: wordpress:latest volumes: - wp_data:/var/www/html ports: - 80:80 restart: always environment: - WORDPRESS_DB_HOST=db - WORDPRESS_DB_USER=wordpress - WORDPRESS_DB_PASSWORD=wordpress - WORDPRESS_DB_NAME=wordpress volumes: wp_data: 

(4)重新用docker compose up命令启动即可

原文链接:https://blog.csdn.net/m0_64284147/article/details/127039271?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522168623078216800226541510%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=168623078216800226541510&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~times_rank-6-127039271-null-null.268%5Ev1%5Ekoosearch&utm_term=docker%E3%80%81wordpress%E3%80%81wordpress%E5%BB%BA%E7%AB%99%E3%80%81wordpress%E4%B8%BB%E9%A2%98%E3%80%81%E5%AE%B9%E5%99%A8%E9%95%9C%E5%83%8F%E3%80%81

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享