title: Symfony 5 SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed:
body: <p>I am trying to run</p>
  
  <pre><code> php bin/console make:migration
  </code></pre>
  
  <p>I received these errors</p>
  
  <pre><code>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
  </code></pre>
  
  <p>I have checked all of my .env files. I have configured the </p>
  
  <pre><code>DATABASE_URL=mysql://mylocalDb:#fL3@&amp;_{Dx3N@127.0.0.1:3306/LocalDataBase
  </code></pre>
  
  <p>I have changed the doctrine config to use server_version: '5.7'. I don't know for sure if that correct. I just removed the # from in front of the line because of the note that said you must configure your server version. But not sure which server it is referring to.</p>
  
  <p>So, my question is how do I test the database connection in Symfony. I have searched the documents and was unable to find a clear answer to this question. When I run </p>
  
  <pre><code> php bin/console doctrine:database:create
  </code></pre>
  
  <p>This produces an error</p>
  
  <pre><code> In CreateDatabaseDoctrineCommand.php line 82:
     Connection does not contain a 'path' or 'dbname' parameter and cannot be created.
  </code></pre>
  
  <p>I have cleared my cache twice after making config changes and still receive the same error messages. 
  What other ways can I test the db connection.</p>
  
  <p><a href="https://symfony.com/doc/current/doctrine.html#configuring-the-database" rel="nofollow noreferrer">https://symfony.com/doc/current/doctrine.html#configuring-the-database</a></p>