- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经根据本教程设置了一个服务器来托管多个网站:https://blog.ssdnodes.com/blog/host-multiple-ssl-websites-docker-nginx/
我还为 wordpress 配置了一个 docker-compose.yml,就像他们在同一教程的示例 2 中所做的那样。但是当我打开网站时,出现“建立数据库连接时出错”的错误。我记得几个月前做这件事时一切正常,但我不记得我做了什么不同的事情。
这是我在输入 docker-compose up 后(多次)收到的错误消息
wp_test | MySQL Connection Error: (1045) Access denied for user 'wordpress'@'172.20.0.9' (using password: YES)
wp_test_db | 2020-02-23T21:00:45.772510Z 11 [Note] Access denied for user 'wordpress'@'172.20.0.9' (using password: YES)
我的 docker-compose.yml 文件如下所示:
version: "3"
services:
db_node_domain:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
container_name: wp_test_db
wordpress:
depends_on:
- db_node_domain
image: wordpress:latest
expose:
- 80
restart: always
environment:
VIRTUAL_HOST: blog.example.com
LETSENCRYPT_HOST: blog.example.com
LETSENCRYPT_EMAIL: foo@example.com
WORDPRESS_DB_HOST: db_node_domain:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
container_name: wp_test
volumes:
db_data:
networks:
default:
external:
name: nginx-proxy
我已尝试停止和启动图像,如此处所建议:https://www.reddit.com/r/docker/comments/ahzv5d/wordpress_cant_connect_to_mysql/
我也尝试了另一个 wordpress docker-config.yml 并自己添加了 nginx 参数,但得到了相同的错误消息 https://docs.docker.com/compose/wordpress/
编辑我收到了新的错误消息
wp_test_db | 2020-02-23T22:09:40.654580Z 0 [Note] mysqld (mysqld 5.7.29) starting as process 1 ...
wp_test_db | 2020-02-23T22:09:40.659627Z 0 [Note] InnoDB: PUNCH HOLE support available
wp_test_db | 2020-02-23T22:09:40.659883Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
wp_test_db | 2020-02-23T22:09:40.659958Z 0 [Note] InnoDB: Uses event mutexes
wp_test_db | 2020-02-23T22:09:40.660412Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
wp_test_db | 2020-02-23T22:09:40.660451Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
wp_test_db | 2020-02-23T22:09:40.660811Z 0 [Note] InnoDB: Using Linux native AIO
wp_test_db | 2020-02-23T22:09:40.661814Z 0 [Note] InnoDB: Number of pools: 1
wp_test_db | 2020-02-23T22:09:40.662418Z 0 [Note] InnoDB: Using CPU crc32 instructions
wp_test_db | 2020-02-23T22:09:40.667522Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
wp_test_db | 2020-02-23T22:09:40.681674Z 0 [Note] InnoDB: Completed initialization of buffer pool
wp_test_db | 2020-02-23T22:09:40.687033Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
wp_test_db | 2020-02-23T22:09:40.701423Z 0 [ERROR] [FATAL] InnoDB: Table flags are 0 in the data dictionary but the flags in file ./ibdata1 are 0x4000!
wp_test_db | 2020-02-23 22:09:40 0x7f7ce62ee740 InnoDB: Assertion failure in thread 140174414505792 in file ut0ut.cc line 918
wp_test_db | InnoDB: We intentionally generate a memory trap.
wp_test_db | InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
wp_test_db | InnoDB: If you get repeated assertion failures or crashes, even
wp_test_db | InnoDB: immediately after the mysqld startup, there may be
wp_test_db | InnoDB: corruption in the InnoDB tablespace. Please refer to
wp_test_db | InnoDB: http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html
wp_test_db | InnoDB: about forcing recovery.
wp_test_db | 22:09:40 UTC - mysqld got signal 6 ;
wp_test_db | This could be because you hit a bug. It is also possible that this binary
wp_test_db | or one of the libraries it was linked against is corrupt, improperly built,
wp_test_db | or misconfigured. This error can also be caused by malfunctioning hardware.
wp_test_db | Attempting to collect some information that could help diagnose the problem.
wp_test_db | As this is a crash and something is definitely wrong, the information
wp_test_db | collection process might fail.
wp_test_db |
wp_test_db | key_buffer_size=8388608
wp_test_db | read_buffer_size=131072
wp_test_db | max_used_connections=0
wp_test_db | max_threads=151
wp_test_db | thread_count=0
wp_test_db | connection_count=0
wp_test_db | It is possible that mysqld could use up to
wp_test_db | key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 68196 K bytes of memory
wp_test_db | Hope that's ok; if not, decrease some variables in the equation.
wp_test_db |
wp_test_db | Thread pointer: 0x0
wp_test_db | Attempting backtrace. You can use the following information to find out
wp_test_db | where mysqld died. If you see no messages after this, something went
wp_test_db | terribly wrong...
wp_test_db | stack_bottom = 0 thread_stack 0x40000
wp_test_db | mysqld(my_print_stacktrace+0x2c)[0x5643574c60cc]
wp_test_db | mysqld(handle_fatal_signal+0x479)[0x564356de87b9]
wp_test_db | /lib/x86_64-linux-gnu/libpthread.so.0(+0x110e0)[0x7f7ce5ecb0e0]
wp_test_db | /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcf)[0x7f7ce4657fff]
wp_test_db | /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7f7ce465942a]
wp_test_db | mysqld(+0x699b25)[0x564356dbeb25]
wp_test_db | mysqld(_ZN2ib5fatalD1Ev+0x12d)[0x56435782ed8d]
wp_test_db | mysqld(+0x11b68f1)[0x5643578db8f1]
wp_test_db | mysqld(+0x11b6f28)[0x5643578dbf28]
wp_test_db | mysqld(_Z6fil_ioRK9IORequestbRK9page_id_tRK11page_size_tmmPvS8_+0x2b0)[0x5643578e5110]
wp_test_db | mysqld(_Z13buf_read_pageRK9page_id_tRK11page_size_t+0xce)[0x56435789a33e]
wp_test_db | mysqld(_Z16buf_page_get_genRK9page_id_tRK11page_size_tmP11buf_block_tmPKcmP5mtr_tb+0x4aa)[0x56435786957a]
wp_test_db | mysqld(_Z31trx_rseg_get_n_undo_tablespacesPm+0x143)[0x56435780d1f3]
wp_test_db | mysqld(+0x698c99)[0x564356dbdc99]
wp_test_db | mysqld(_Z34innobase_start_or_create_for_mysqlv+0x2f3d)[0x5643577da06d]
wp_test_db | mysqld(+0xf80438)[0x5643576a5438]
wp_test_db | mysqld(_Z24ha_initialize_handlertonP13st_plugin_int+0x4f)[0x564356e390ff]
wp_test_db | mysqld(+0xb8c0f6)[0x5643572b10f6]
wp_test_db | mysqld(_Z40plugin_register_builtin_and_init_core_sePiPPc+0x2f0)[0x5643572b4300]
wp_test_db | mysqld(+0x6bbece)[0x564356de0ece]
wp_test_db | mysqld(_Z11mysqld_mainiPPc+0xc71)[0x564356de2a71]
wp_test_db | /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1)[0x7f7ce46452e1]
wp_test_db | mysqld(_start+0x2a)[0x564356dd8eaa]
wp_test_db | The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
wp_test_db | information that should help you find out what is causing the crash.
最佳答案
你的 yaml 文件对我来说工作正常。我唯一注意到的是 wordpress.environment (WORDPRESS_DB_NAME=wordpress
) 中缺少数据库名称变量,但如果找不到,则默认为 wordpress
。我指出这一点是为了防止您的实际副本具有 wordpress 以外的数据库名称。
这是适合我的撰写文件:
version: "3"
services:
db_node_domain:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
container_name: wp_test_db
wordpress:
depends_on:
- db_node_domain
image: wordpress:latest
ports:
- '8000:80'
expose:
- 80
restart: always
environment:
VIRTUAL_HOST: blog.example.com
LETSENCRYPT_HOST: blog.example.com
LETSENCRYPT_EMAIL: foo@example.com
WORDPRESS_DB_HOST: db_node_domain:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress # THIS WAS MISSING?
container_name: wp_test
volumes:
db_data:
networks:
default:
external:
name: nginx-proxy
如果您想重新开始并重试,您可以运行 docker-compose down
然后运行 docker-compose up
。 这会破坏一切所以要小心 :)
关于mysql - WordPress docker "Error establishing a database connection",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60366969/
我最近开始使用 MSpec,将类分为 Establish、Because 和 It。 虽然我知道如何使用它们,但我不确定是什么让它们起作用。 我知道他们是代表 Because of = () => {
我的理解是每个 Establish 应该只执行一次,但下面的代码显示它执行了多次。我们嵌套类以提供一些分组,同时将 Subject 的单元测试保留在一个文件中。这似乎是一个错误。 我们正在使用 mac
我一直在谷歌上广泛搜索,试图解决这个问题,但似乎找不到解决方案。我正在尝试在我的 Chrome 扩展程序中完成设置监听器和发送器的简单任务。 我的 list { "manifest_version
这个错误是我从 lastError.js 文件中得到的,我没有在我的 html 页面中调用它。 var errorMessage = name + ': ' + message; if (sta
我的一个 AMQ 生产者有问题,我有网络问题,因此它无法向 Q 发送消息。然而,服务器打开与 Q 机器的连接并保持它们完好无损。连接数增加,Q 机器窒息,无法为其其余生产者和消费者提供服务。 这是我在
尝试从弹出窗口向我的 contentscript 发送消息时出现此错误。我想要做的是从我的 content.js 获取当前选项卡的文档并将其发送到弹出窗口。我该如何解决这个错误? { "manif
我有一个 Java 网络爬虫。我注意到,对于我抓取的少量服务器,我留下了大量已建立的套接字: joel@bohr:~/tmp/test$ lsof -p 6760 | grep TCP java
我正在使用 Unitt 库 ( http://code.google.com/p/unitt/wiki/UnittWebSocketClient ) 尝试在我的 iOS (iPhone) 应用程序中通
我正在使用 EWS Java API 连接 Exchange 服务器并检索有关邮件、日历约会和任务的信息。 除一个帐户外,它适用于许多用户。我收到以下错误: microsoft.exchange.we
我想使用 C/C++ 获取到我的服务器的 SYN 和 ESTABLISHED 连接数。但我不想调用 popen 来运行 netstat 或任何其他 Linux 命令。我设法扫描了/proc/net/i
我正在测试应用程序尝试访问未知 URL 时的行为。引发 ConnectionError 需要 5 秒。我怎样才能修改为在 100 毫秒时失败? 我尝试使用 requests.get(url, time
当我尝试为我的 VpnService 创建隧道接口(interface)时,出现以下错误: Attempt to invoke virtual method 'java.lang.String and
如果有一个网络服务器在端口 80 上运行,并且有人使用随机分配的端口 x 从客户端连接,那么服务器知道要回复哪个端口。但是,从那时起,与服务器的通信是否从那时起继续在端口 80 上进行(将文件描述符分
我做了一个实验: 一个监听8804端口的服务器接受一个客户端的连接,然后无休止地向客户端发送数据。我关闭了网络。 当我运行 netstat -anotp | grep 8804 ,显示服务器和客户端的
我正在尝试使用 JSch通过 ssh 连接到我的计算机,然后运行命令。 但是,当我运行代码时,我从未连接到计算机。和以下错误: I/System.out: com.jcraft.jsch.JSchEx
关闭。这个问题是off-topic .它目前不接受答案。 想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。 8年前关闭。 Improve this q
尝试为我们的Intranet的Web服务站点设置一个自签名证书。证书本身表明它是“ok”,但是当尝试从Web服务调用方法时,它会引发错误,并且在添加Web引用时也会给出警告。 这是确保我提供准确信息的
我正在使用 JavaScript 和 Union platform我将如何诊断这个问题?非常感谢。 最佳答案 如果你去http://jsbin.com/ekusep/6/edit并查看 JavaScr
我正在尝试设置一个保存点,并在遇到问题时回滚到该点。但我收到以下消息: SQL execution error, ORA-01086: savepoint 'LASTSAVE' never estab
我只有一个托管对象上下文。 不过我已经修改了托管对象存储。 我想将某些字段添加到每个托管对象中。将它们一一添加到系统中的每个对象会花费太多时间,因此我决定以编程方式将它们添加到托管对象模型中。在应用程
我是一名优秀的程序员,十分优秀!