Answers.Body: <p>Parvez is right that you can use a different DATABASE but if you mean a different HOST then the answer is no. The triggers that are used don't support that.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-17T14:34:59.283Z
Answers.Text: Yeah I was thinking about that but as you pointed out if the triggers themselves don't allow a different host but there are workarounds to this at the MariaDB/MySQL layer if you really wanted to do it. It would need a patch to the code that generates the logging tables - something along these lines https://stackoverflow.com/questions/26503342/how-to-create-trigger-to-insert-data-to-a-database-on-another-server
Answers.UserDisplayName: Parvez Saleh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-17T14:55:31.137Z
Answers.Text: Ah cool. Didn't know you could create tables like that.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-17T11:32:16.357Z
Answers.LastActivityDate: 2020-09-17T11:32:16.357Z
Answers.UserDisplayName: Demerit
Answers.Body: <p>Yes perfectly possible, we do it all the time. You can set the logging DSN in your settings file (CIVICRM_LOGGING_DSN) if its not set then CiviCRM falls back to the CIVICRM_DSN</p>
  <p>Sorry - just read your whole question!</p>
  <p>I would check that the user has permissions from the CIVICRM_DSN to the CIVICRM_LOGGING_DSN i.e. if the CiviCRM database user cannot access the logging database then maybe thats causing the issue.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-17T11:18:42.497Z
Answers.LastActivityDate: 2020-09-17T11:18:42.497Z
Answers.UserDisplayName: Parvez Saleh
Body: <p>Is it possible? Used the different database on remote server for civicrm logging.
  Means: Currently i am using two databases one for drupal and second is using for Civicrm. Both are on different remote server.  Now i want to create a third server for civicrm logging database. It is showing error &quot;DB Error: no such database&quot;. I already configured in civicrm.settings.php file.
  define('CIVICRM_LOGGING_DSN',mysql://myserverdetail);</p>
  
Tags: <drupal><civicrm.settings.php>
Title: Can i used different Database on remote server for civicrm logging?
ThreadText: # Can i used different Database on remote server for civicrm logging?
  
  (Asked by: username_0 on 2020-09-17)
  
  Is it possible? Used the different database on remote server for civicrm logging.
  Means: Currently i am using two databases one for drupal and second is using for Civicrm. Both are on different remote server. Now i want to create a third server for civicrm logging database. It is showing error "DB Error: no such database". I already configured in civicrm.settings.php file.
  define('CIVICRM\_LOGGING\_DSN',mysql://myserverdetail);
  
  **Tags:** drupal, civicrm.settings.php
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2020-09-17. Score: 2 | Accepted answer
  
  Parvez is right that you can use a different DATABASE but if you mean a different HOST then the answer is no. The triggers that are used don't support that.
  
  > **Comments:**
  > **username_2**: Yeah I was thinking about that but as you pointed out if the triggers themselves don't allow a different host but there are workarounds to this at the MariaDB/MySQL layer if you really wanted to do it. It would need a patch to the code that generates the logging tables - something along these lines https://stackoverflow.com/questions/26503342/how-to-create-trigger-to-insert-data-to-a-database-on-another-server  
  > **username_1**: Ah cool. Didn't know you could create tables like that.  
  
  ---
  
  ### Answer by username_2 on 2020-09-17. Score: 2
  
  Yes perfectly possible, we do it all the time. You can set the logging DSN in your settings file (CIVICRM\_LOGGING\_DSN) if its not set then CiviCRM falls back to the CIVICRM\_DSN
  
  Sorry - just read your whole question!
  
  I would check that the user has permissions from the CIVICRM\_DSN to the CIVICRM\_LOGGING\_DSN i.e. if the CiviCRM database user cannot access the logging database then maybe thats causing the issue.
  
  
  ---
  
  