我正在尝试运行 php bin/console make:migration我收到了这些错误In AbstractMySQLDriver.php line 93: An exception occurred in driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution In PDOConnection.php line 31: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution In PDOConnection.php line 27: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution In PDOConnection.php line 27: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution我已经检查了我的所有.env文件。我已配置DATABASE_URL=mysql://mylocalDb:#fL3@&_{Dx3N@127.0.0.1:3306/LocalDataBase我已将教义配置更改为使用server_version:“5.7”。我不确定这是否正确。我刚刚从前面的行中删除了#,因为说明您必须配置服务器版本。但不确定它指的是哪个服务器。因此,我的问题是如何在Symfony中测试数据库连接。我搜索了文件,但无法找到这个问题的明确答案。当我跑步时 php bin/console doctrine:database:create这将产生错误 In CreateDatabaseDoctrineCommand.php line 82: Connection does not contain a 'path' or 'dbname' parameter and cannot be created.在进行配置更改后,我已经清除了两次缓存,但仍然收到相同的错误消息。我还可以通过哪些其他方法测试数据库连接。https://symfony.com/doc/current/doctrine.html#configuring-the-database
2 回答

幕布斯6054654
TA贡献1876条经验 获得超7个赞
就像伊库丘科夫说的,“”字打破了解析。但是,在我看来,而不是更改密码,URL编码此字符将做得更好。您可以将其替换为其 url 编码值 “”。@
%40
- 2 回答
- 0 关注
- 212 浏览
添加回答
举报
0/150
提交
取消