我正在尝试运行
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
江户川乱折腾
幕布斯6054654