【发布时间】:2021-03-23 14:01:52
【问题描述】:
我想使用 docker 启动一个 Symfony 项目! 我尝试使用 DDEV CLI 构建它! https://ddev.readthedocs.io/en/stable/users/cli-usage/
我使用了 DDEV 的标准配置。 (php)
只要我想做:
php bin/console make:migration
我明白了:
An exception occurred in driver: SQLSTATE[HY000] [2002] php_network_getaddresses:
getaddrinfo failed: nodename nor servname provided, or not known
.env 文件:
DATABASE_URL="mysql://db:db@db:3306/db?serverVersion=10.2"
当我将主机更改为 .env 中的 127.0.0.1 时:
DATABASE_URL="mysql://db:db@127.0.0.1:3306/db?serverVersion=10.2"
我明白了:
An exception occurred in driver: SQLSTATE[HY000] [2054] The server requested
authentication method unknown to the client
DDEV config.yaml
name: bib
type: php
docroot: public
php_version: "7.3"
webserver_type: nginx-fpm
router_http_port: "80"
router_https_port: "443"
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: []
provider: default
use_dns_when_possible: true
请在这方面寻求帮助。
【问题讨论】:
-
请分享更多详细信息 - 您如何确切致电
php bin/console?从 在 ddev 容器中? -
@NicoHaase 我错过了!如果我在 (DDEV ssh) 内部运行 php bin/console 工作正常!我想这回答了我的问题!使用 db 作为主机一切正常!谢谢!