• <i id='TtaTO'><tr id='TtaTO'><dt id='TtaTO'><q id='TtaTO'><span id='TtaTO'><b id='TtaTO'><form id='TtaTO'><ins id='TtaTO'></ins><ul id='TtaTO'></ul><sub id='TtaTO'></sub></form><legend id='TtaTO'></legend><bdo id='TtaTO'><pre id='TtaTO'><center id='TtaTO'></center></pre></bdo></b><th id='TtaTO'></th></span></q></dt></tr></i><div id='TtaTO'><tfoot id='TtaTO'></tfoot><dl id='TtaTO'><fieldset id='TtaTO'></fieldset></dl></div>
      <bdo id='TtaTO'></bdo><ul id='TtaTO'></ul>

    <tfoot id='TtaTO'></tfoot>

        <legend id='TtaTO'><style id='TtaTO'><dir id='TtaTO'><q id='TtaTO'></q></dir></style></legend>

        <small id='TtaTO'></small><noframes id='TtaTO'>

      1. Docker:链接到 mysql 容器的 Drupal 容器在 Drupal 安装期间无法连接到 mysql

        时间:2024-04-15
          <tfoot id='gc9SE'></tfoot>
            <tbody id='gc9SE'></tbody>

          <small id='gc9SE'></small><noframes id='gc9SE'>

          <legend id='gc9SE'><style id='gc9SE'><dir id='gc9SE'><q id='gc9SE'></q></dir></style></legend>

            • <bdo id='gc9SE'></bdo><ul id='gc9SE'></ul>
              <i id='gc9SE'><tr id='gc9SE'><dt id='gc9SE'><q id='gc9SE'><span id='gc9SE'><b id='gc9SE'><form id='gc9SE'><ins id='gc9SE'></ins><ul id='gc9SE'></ul><sub id='gc9SE'></sub></form><legend id='gc9SE'></legend><bdo id='gc9SE'><pre id='gc9SE'><center id='gc9SE'></center></pre></bdo></b><th id='gc9SE'></th></span></q></dt></tr></i><div id='gc9SE'><tfoot id='gc9SE'></tfoot><dl id='gc9SE'><fieldset id='gc9SE'></fieldset></dl></div>

                  本文介绍了Docker:链接到 mysql 容器的 Drupal 容器在 Drupal 安装期间无法连接到 mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我对 docker 还很陌生,我刚刚浏览了 CMS,看看它们的配置有多容易.到目前为止,Wordpress 和 Joomla 已经完成.

                  I'm fairly new to docker, and I've just been going through the CMS's to see how easy they are to configure. So far, Wordpress and Joomla check out.

                  当我运行链接到 mysql 的 drupal 容器时,我进入了 drupal 安装屏幕,它说连接数据库,我使用我的根凭据和数据库主机作为本地主机",并收到尝试连接的错误.我附上了一张图片来向您展示输出.drupal-config-db-output-error

                  When I run the drupal container linked to mysql, I get to the drupal installation screen and where it says to connect the DB, and I use my root credentials and db host being 'localhost', and receive errors trying to connect. I've attached an image to show you the output.drupal-config-db-output-error

                  我得到的错误:

                  Failed to connect to your database server. The server reports the following message: SQLSTATE[HY000] [2002] No such file or directory.
                  

                  对此的任何帮助都会很棒.我试图查看是否可以使用配置文件访问物理卷,但我无法使用 Kitematic 找到它们.

                  Any help on this would be great. I tried to see if I could access the physical the volume with the config files, but I couldn't find them using Kitematic.

                  谢谢!

                  推荐答案

                  以下docker compose文件将启动 Drupal 连接到另一个运行 Mysql 的容器

                  The following docker compose file will startup Drupal connected to another container running Mysql

                  db:
                    image: mysql
                    environment:
                      - MYSQL_ROOT_PASSWORD=letmein
                      - MYSQL_DATABASE=drupal
                      - MYSQL_USER=drupal
                      - MYSQL_PASSWORD=drupal
                    volumes:
                      - /var/lib/mysql
                  web:
                    image: drupal
                    links:
                      - db:mysql
                    ports:
                      - "8080:80"
                    volumes:
                      - /var/www/html/sites
                      - /var/www/private
                  

                  请注意,drupal 容器使用 docker 链接.这将创建一个名为mysql"的/etc/hosts 条目.在运行 drupal 安装屏幕时使用它而不是localhost".

                  Note that the drupal container uses docker links. This will create a /etc/hosts entry called "mysql". Use this instead of "localhost" when running the drupal install screens.

                  自从最初起草此答案以来,docker compose 文件语法已更改.

                  The docker compose file syntax has changed since this answer was originally drafted.

                  这里是更新的语法

                  version: '2'
                  services:
                    mysql:
                      image: mysql
                      environment:
                        - MYSQL_ROOT_PASSWORD=letmein
                        - MYSQL_DATABASE=drupal
                        - MYSQL_USER=drupal
                        - MYSQL_PASSWORD=drupal
                      volumes:
                        - /var/lib/mysql
                    web:
                      image: drupal
                      depends_on:
                        - mysql
                      ports:
                        - "8080:80"
                      volumes:
                        - /var/www/html/sites
                        - /var/www/private
                  

                  这篇关于Docker:链接到 mysql 容器的 Drupal 容器在 Drupal 安装期间无法连接到 mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:drupal 视图模块 mysql 错误 下一篇:收集数据,然后将数据导入 Drupal 的最佳方法?

                  相关文章

                  <i id='VPCL9'><tr id='VPCL9'><dt id='VPCL9'><q id='VPCL9'><span id='VPCL9'><b id='VPCL9'><form id='VPCL9'><ins id='VPCL9'></ins><ul id='VPCL9'></ul><sub id='VPCL9'></sub></form><legend id='VPCL9'></legend><bdo id='VPCL9'><pre id='VPCL9'><center id='VPCL9'></center></pre></bdo></b><th id='VPCL9'></th></span></q></dt></tr></i><div id='VPCL9'><tfoot id='VPCL9'></tfoot><dl id='VPCL9'><fieldset id='VPCL9'></fieldset></dl></div>
                  <legend id='VPCL9'><style id='VPCL9'><dir id='VPCL9'><q id='VPCL9'></q></dir></style></legend>

                  <small id='VPCL9'></small><noframes id='VPCL9'>

                    1. <tfoot id='VPCL9'></tfoot>
                      • <bdo id='VPCL9'></bdo><ul id='VPCL9'></ul>