Answers.Body: <p>Alex, Welcome to Civi stackexchange.</p>
  <p>If the server is running with global transaction identifiers (GTIDs) enabled (gtid_mode=ON), do not enable binary logging. Try turning it off</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-27T23:49:04.770Z
Answers.Text: Thanks for the prompt reply. These are the settings - gtid_mode=OFF and log_bin=ON.  Perhaps setting enforce_gtid_consistency=OFF may fix it?
Answers.UserDisplayName: Alex
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-28T00:09:46.633Z
Answers.Text: Yes may be... Can you try..
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-28T15:56:49.150Z
Answers.Text: Oof. Seems that we can't get admin privileges on phpMyAdmin to change variables, as a result of shared hosting.
Answers.UserDisplayName: Alex
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-27T23:29:26.133Z
Answers.LastActivityDate: 2020-08-27T23:29:26.133Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>I recently upgraded my WordPress CiviCRM from 5.25 to 5.28 and in doing so needed to migrate the SQL old 5.5 database to 5.7.  The upgrades went fine, but I now have an error when trying to send group emails through CiviMail:</p>
  <p>Error in call to Mailing_send_test : DB Error: unknown error</p>
  <pre><code>Aug 27 15:28:58  [error] $Fatal Error Details = Array
  (
      [callback] =&gt; Array
          (
              [0] =&gt; CRM_Core_Error
              [1] =&gt; exceptionHandler
          )
  
      [code] =&gt; -1
      [message] =&gt; DB Error: unknown error
      [mode] =&gt; 16
      [debug_info] =&gt; CREATE TEMPORARY TABLE `civicrm_tmp_e_gccache_5999aedd9eade6251afdc6974a96b5b1` (contact_id int, group_id int, UNIQUE UI_contact_group (contact_id,group_id)) ENGINE=MEMORY DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci [nativecode=1787 ** Statement violates GTID consistency: CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can only be executed outside transactional context.  These statements are also not allowed in a function or trigger because functions and triggers are also considered to be multi-statement transactions.]
      [type] =&gt; DB_Error
      [user_info] =&gt; CREATE TEMPORARY TABLE `civicrm_tmp_e_gccache_5999aedd9eade6251afdc6974a96b5b1` (contact_id int, group_id int, UNIQUE UI_contact_group (contact_id,group_id)) ENGINE=MEMORY DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci [nativecode=1787 ** Statement violates GTID consistency: CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can only be executed outside transactional context.  These statements are also not allowed in a function or trigger because functions and triggers are also considered to be multi-statement transactions.]
      [to_string] =&gt; [db_error: message=&quot;DB Error: unknown error&quot; code=-1 mode=callback callback=CRM_Core_Error::exceptionHandler prefix=&quot;&quot; info=&quot;CREATE TEMPORARY TABLE `civicrm_tmp_e_gccache_5999aedd9eade6251afdc6974a96b5b1` (contact_id int, group_id int, UNIQUE UI_contact_group (contact_id,group_id)) ENGINE=MEMORY DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci [nativecode=1787 ** Statement violates GTID consistency: CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can only be executed outside transactional context.  These statements are also not allowed in a function or trigger because functions and triggers are also considered to be multi-statement transactions.]&quot;]
  )
  </code></pre>
  <p>I've tried cleaning up caches but stumped for any other ideas.  Please help.</p>
  <p>Kind regards,
  Alex</p>
  
Tags: <wordpress><civimail><mysql>
Title: DB Error: unknown error when sending CiviMail
ThreadText: # DB Error: unknown error when sending CiviMail
  
  (Asked by: username_0 on 2020-08-27)
  
  I recently upgraded my WordPress CiviCRM from 5.25 to 5.28 and in doing so needed to migrate the SQL old 5.5 database to 5.7.  The upgrades went fine, but I now have an error when trying to send group emails through CiviMail:
  Error in call to Mailing_send_test : DB Error: unknown error
  Aug 27 15:28:58  [error] $Fatal Error Details = Array
  (
      [callback] => Array
          (
              [0] => CRM_Core_Error
              [1] => exceptionHandler
          )
  
      [code] => -1
      [message] => DB Error: unknown error
      [mode] => 16
      [debug_info] => CREATE TEMPORARY TABLE `civicrm_tmp_e_gccache_5999aedd9eade6251afdc6974a96b5b1` (contact_id int, group_id int, UNIQUE UI_contact_group (contact_id,group_id)) ENGINE=MEMORY DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci [nativecode=1787 ** Statement violates GTID consistency: CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can only be executed outside transactional context.  These statements are also not allowed in a function or trigger because functions and triggers are also considered to be multi-statement transactions.]
      [type] => DB_Error
      [user_info] => CREATE TEMPORARY TABLE `civicrm_tmp_e_gccache_5999aedd9eade6251afdc6974a96b5b1` (contact_id int, group_id int, UNIQUE UI_contact_group (contact_id,group_id)) ENGINE=MEMORY DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci [nativecode=1787 ** Statement violates GTID consistency: CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can only be executed outside transactional context.  These statements are also not allowed in a function or trigger because functions and triggers are also considered to be multi-statement transactions.]
      [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="CREATE TEMPORARY TABLE `civicrm_tmp_e_gccache_5999aedd9eade6251afdc6974a96b5b1` (contact_id int, group_id int, UNIQUE UI_contact_group (contact_id,group_id)) ENGINE=MEMORY DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci [nativecode=1787 ** Statement violates GTID consistency: CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can only be executed outside transactional context.  These statements are also not allowed in a function or trigger because functions and triggers are also considered to be multi-statement transactions.]"]
  )
  
  I've tried cleaning up caches but stumped for any other ideas.  Please help.
  Kind regards,
  username_0
  
  **Tags:** wordpress, civimail, mysql
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-08-27. Score: 1
  
  username_0, Welcome to Civi stackexchange.
  
  If the server is running with global transaction identifiers (GTIDs) enabled (gtid\_mode=ON), do not enable binary logging. Try turning it off
  
  > **Comments:**
  > **username_0**: Thanks for the prompt reply. These are the settings - gtid_mode=OFF and log_bin=ON.  Perhaps setting enforce_gtid_consistency=OFF may fix it?  
  > **username_1**: Yes may be... Can you try..  
  > **username_0**: Oof. Seems that we can't get admin privileges on phpMyAdmin to change variables, as a result of shared hosting.  
  
  ---
  
  