Body: <p>I am trying to switch from RDS to Aurora DB for test site to see if it is viable.  I am confused with the first problem I am running into and I am not sure why CiviCRM would have this issue.  Drupal 8 can connect to the database server using the same credentials as we are trying to use for CiviCRM.</p>
  <p>I get the following error:</p>
  <pre><code>Initialization Error
  
  Array
  (
      [callback] =&gt; Array
          (
              [0] =&gt; CRM_Core_Error
              [1] =&gt; simpleHandler
          )
  
  [code] =&gt; -24
  [message] =&gt; DB Error: connect failed
  [mode] =&gt; 16
  [debug_info] =&gt;  [nativecode=php_network_getaddresses: getaddrinfo failed: Name or service not known]
  [type] =&gt; DB_Error
  [user_info] =&gt;  [nativecode=php_network_getaddresses: getaddrinfo failed: Name or service not known]
  [to_string] =&gt; [db_error: message=&quot;DB Error: connect failed&quot; code=-24 mode=callback callback=CRM_Core_Error::simpleHandler prefix=&quot;&quot; info=&quot; [nativecode=php_network_getaddresses: getaddrinfo failed: Name or service not known]&quot;]
  </code></pre>
  <p>)</p>
  <p>The error comes up twice on the screen or the command prompt so I am guessing this error is for both the CiviCRM connection string to the CiviCRM database and the CiviCRM connection to the Drupal database. They are two databases in the same instance.</p>
  <p>My database string looks correct to me and matches what I have for the existing RDS instance.</p>
  <pre><code>mysql://user:password@db_name-aurora-cluster.cluster-ctaoxt42sdhl.region.rds.amazonaws.com:3306/d8dev?new_link=true')
  </code></pre>
  <p>I am using Amazon Aurora with MySQL support. Drupal is able to connect (drush status) and I can login into MySQL from the command line and was able to execute an update query.</p>
  <p>Any ideas are greatly appreciated.</p>
  <p>Thanks!</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-31T16:37:01.733Z
Comments.Text: Do you have any `+` signs in the real values? If they aren't urlencoded (`%2B`) then pear::db will interpret them specially. The error sounds like it's not parsing the string correctly and is getting the host wrong so DNS lookup fails. You can try putting `CRM_Core_Error::debug_log_message(print_r($dsn, true));` around line 293 in the connect() function in vendor/pear/db/DB/mysqli.php and then look in [ConfigAndLog](https://civicrm.stackexchange.com/q/15931/181) to see how it's getting parsed.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-05T18:57:37.560Z
Comments.Text: Alternatively, I wonder if the php code that parses the database connect string doesn't like that long domain name or one of its characters. That format and probably the code of the db connect string is pretty old and may carry some outdated assumptions about what a domain might look like. You could try replacing it with whatever that domain's current ip is and see if it works at least temporarily.
Comments.UserDisplayName: Alan Dixon
Tags: <database>
Title: CiviCRM Cannot Connect To Aurora DB
ThreadText: # CiviCRM Cannot Connect To Aurora DB
  
  (Asked by: username_0 on 2020-12-31)
  
  I am trying to switch from RDS to Aurora DB for test site to see if it is viable.  I am confused with the first problem I am running into and I am not sure why CiviCRM would have this issue.  Drupal 8 can connect to the database server using the same credentials as we are trying to use for CiviCRM.
  I get the following error:
  Initialization Error
  
  Array
  (
      [callback] => Array
          (
              [0] => CRM_Core_Error
              [1] => simpleHandler
          )
  
  [code] => -24
  [message] => DB Error: connect failed
  [mode] => 16
  [debug_info] =>  [nativecode=php_network_getaddresses: getaddrinfo failed: Name or service not known]
  [type] => DB_Error
  [user_info] =>  [nativecode=php_network_getaddresses: getaddrinfo failed: Name or service not known]
  [to_string] => [db_error: message="DB Error: connect failed" code=-24 mode=callback callback=CRM_Core_Error::simpleHandler prefix="" info=" [nativecode=php_network_getaddresses: getaddrinfo failed: Name or service not known]"]
  
  )
  The error comes up twice on the screen or the command prompt so I am guessing this error is for both the CiviCRM connection string to the CiviCRM database and the CiviCRM connection to the Drupal database. They are two databases in the same instance.
  My database string looks correct to me and matches what I have for the existing RDS instance.
  mysql://user:password@db_name-aurora-cluster.cluster-ctaoxt42sdhl.region.rds.amazonaws.com:3306/d8dev?new_link=true')
  
  I am using Amazon Aurora with MySQL support. Drupal is able to connect (drush status) and I can login into MySQL from the command line and was able to execute an update query.
  Any ideas are greatly appreciated.
  Thanks!
  
  **Tags:** database
  
  > **Comments:**
  > **username_1**: Do you have any `+` signs in the real values? If they aren't urlencoded (`%2B`) then pear::db will interpret them specially. The error sounds like it's not parsing the string correctly and is getting the host wrong so DNS lookup fails. You can try putting `CRM_Core_Error::debug_log_message(print_r($dsn, true));` around line 293 in the connect() function in vendor/pear/db/DB/mysqli.php and then look in [ConfigAndLog](https://civicrm.stackexchange.com/q/15931/181) to see how it's getting parsed.  
  > **username_2**: Alternatively, I wonder if the php code that parses the database connect string doesn't like that long domain name or one of its characters. That format and probably the code of the db connect string is pretty old and may carry some outdated assumptions about what a domain might look like. You could try replacing it with whatever that domain's current ip is and see if it works at least temporarily.  
  
  ---
  
  ## 0 answers
  
  