Answers.Body: <p>Not sure what the problem was, but it seems to have related to our host. We've switched hosts and the problem is solved.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-21T16:39:34.223Z
Answers.LastActivityDate: 2015-08-21T16:39:34.223Z
Answers.UserDisplayName: Phil Morice Brubaker
Answers.Body: <p>Your error log says:</p>
  
  <blockquote>
    <p>** You do not have the SUPER privilege and binary logging is enabled (you <em>might</em> want to use the less safe log_bin_trust_function_creators variable)]</p>
  </blockquote>
  
  <p>If you turn off logging at <strong>Administer > System settings > Misc (Undelete, PDFs, Limits, Logging, Captcha, etc.)</strong>  can you save phone numbers?</p>
  
  <p>You can find information on the MySQL privileges needed for CiviCRM at <a href="http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+MySQL+Permission+Requirements" rel="nofollow">http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+MySQL+Permission+Requirements</a> </p>
  
  <p>Not all hosting companies provide these privileges without a specific request to do so (and even then some will refuse to do so).</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-07T15:42:44.787Z
Answers.Text: Not sure why it says binary logging is enabled, because it is not, according to the misc settings panel. This log is from an instance when I had turned debugging on. Does that automatically enable binary logging? Even if it does, the phone number problem was occurring before that.
Answers.UserDisplayName: Phil Morice Brubaker
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-03T00:17:35.883Z
Answers.LastActivityDate: 2015-07-03T00:17:35.883Z
Answers.UserDisplayName: JoAnne
Answers.Body: <p>I spent hours trying to fix this probably-same problem.  I could edit other contact fields, but phone number always choked.</p>
  
  <p>What finally fixed it for me: </p>
  
  <blockquote>
    <p>$ mysql_upgrade -u root -p</p>
  </blockquote>
  
  <p>The key clue was a mention of "mysql.proc" in a backtrace, which led to a mysql forum.  Apparently, you're supposed to run that command whenever you upgrade mysql.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-18T17:24:46.013Z
Answers.Text: Don't know if that would have solved my problem, since our server change fixed it, but thanks for your answer!
Answers.UserDisplayName: Phil Morice Brubaker
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-10T23:46:55.463Z
Answers.LastActivityDate: 2015-11-10T23:46:55.463Z
Answers.UserDisplayName: David
Answers.Body: <p>For Joomla users, the file located at
  <code>/administrator/components/com_civicrm/civicrm/CRM/Contact/BAO/Contact.php</code> requires a semicolon at line 42:</p>
  
  <pre><code>const DROP_STRIP_FUNCTION_43 = "DROP FUNCTION IF EXISTS civicrm_strip_non_numeric;";
  </code></pre>
  
  <p>I hope this helps.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-15T00:33:33.410Z
Answers.LastActivityDate: 2017-12-28T19:59:03.260Z
Answers.LastEditDate: 2017-12-28T19:59:03.260Z
Answers.UserDisplayName: Vadim
Answers.Body: <p>I had this same problem, caused when DreamHost upgraded from MySQL 5.7 to 8.  Trigger functions aren't supported anymore unless you pay an extra $15/mo for MySQL VPS. For details on my problem see: <a href="https://chat.civicrm.org/civicrm/pl/75p1thb8w3fq9gx9rwsirphy6a" rel="nofollow noreferrer">https://chat.civicrm.org/civicrm/pl/75p1thb8w3fq9gx9rwsirphy6a</a>
  I'm going to look into CiviHosting.com</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-15T15:36:53.713Z
Answers.LastActivityDate: 2022-02-15T15:36:53.713Z
Answers.UserDisplayName: jimcrist
Body: <p>In our organization's new civi database, we are unable to add phone numbers to contacts. I've tried keying in the number and importing a contact with a number. (It took me hours to figure out that it was the phone numbers that were breaking the import!)</p>
  
  <p>There are two error messages we get, depending on the context:</p>
  
  <p>In the View Contact view of the data, when I try to save a phone number, we get this error message:</p>
  
  <blockquote>
    <p>Network Error</p>
    Unable to reach the server. Please refresh this page in your browser
    and try again.</p>
  </blockquote>
  
  <p>In the Edit Contact view, or when trying to import a record with a phone number, we get this error message:</p>
  
  <blockquote>
    <p>Sorry but we are not able to provide this at the moment.</p>
    DB Error: unknown error</p>
    Return to home page.</p>
  </blockquote>
  
  <p>Log is below, and seems to suggest it has something to do with stripping non-integer characters from the field. However, adding a phone number without any dashes 5554443333 also produces the error. Any ideas?</p>
  
  <blockquote>
    <p>Jul 02 12:28:40  [info] $Fatal Error Details = Array
    (
        [callback] => Array
            (
                [0] => CRM_Core_Error
                [1] => handle
            )</p>
  
  <pre><code>[code] =&gt; -1
  [message] =&gt; DB Error: unknown error
  [mode] =&gt; 16
  [debug_info] =&gt; 
  CREATE FUNCTION civicrm_strip_non_numeric(input VARCHAR(255) CHARACTER SET utf8)
    RETURNS VARCHAR(255) CHARACTER SET utf8
    DETERMINISTIC
    NO SQL
  BEGIN
    DECLARE output   VARCHAR(255) CHARACTER SET utf8 DEFAULT '';
    DECLARE iterator INT          DEFAULT 1;
    WHILE iterator &lt; (LENGTH(input) + 1) DO
      IF SUBSTRING(input, iterator, 1) IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9') THEN
        SET output = CONCAT(output, SUBSTRING(input, iterator, 1));
      END IF;
      SET iterator = iterator + 1;
    END WHILE;
    RETURN output;
  END [nativecode=1419 ** You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)]
  [type] =&gt; DB_Error
  [user_info] =&gt; 
  CREATE FUNCTION civicrm_strip_non_numeric(input VARCHAR(255) CHARACTER SET utf8)
    RETURNS VARCHAR(255) CHARACTER SET utf8
    DETERMINISTIC
    NO SQL
  BEGIN
    DECLARE output   VARCHAR(255) CHARACTER SET utf8 DEFAULT '';
    DECLARE iterator INT          DEFAULT 1;
    WHILE iterator &lt; (LENGTH(input) + 1) DO
      IF SUBSTRING(input, iterator, 1) IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9') THEN
        SET output = CONCAT(output, SUBSTRING(input, iterator, 1));
      END IF;
      SET iterator = iterator + 1;
    END WHILE;
    RETURN output;
  END [nativecode=1419 ** You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)]
  [to_string] =&gt; [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="
  CREATE FUNCTION civicrm_strip_non_numeric(input VARCHAR(255) CHARACTER SET utf8)
    RETURNS VARCHAR(255) CHARACTER SET utf8
    DETERMINISTIC
    NO SQL
  BEGIN
    DECLARE output   VARCHAR(255) CHARACTER SET utf8 DEFAULT '';
    DECLARE iterator INT          DEFAULT 1;
    WHILE iterator &lt; (LENGTH(input) + 1) DO
      IF SUBSTRING(input, iterator, 1) IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9') THEN
        SET output = CONCAT(output, SUBSTRING(input, iterator, 1));
      END IF;
      SET iterator = iterator + 1;
    END WHILE;
    RETURN output;
  END [nativecode=1419 ** You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)]"]
  </code></pre>
    
    <p>)</p>
  </blockquote>
  
Tags: <contacts><phone>
Title: DBError and Network Error when saving phone numbers to contacts
ThreadText: # DBError and Network Error when saving phone numbers to contacts
  
  (Asked by: username_0 on 2015-07-02)
  
  In our organization's new civi database, we are unable to add phone numbers to contacts. I've tried keying in the number and importing a contact with a number. (It took me hours to figure out that it was the phone numbers that were breaking the import!)
  There are two error messages we get, depending on the context:
  In the View Contact view of the data, when I try to save a phone number, we get this error message:
  
  Network Error
    Unable to reach the server. Please refresh this page in your browser
    and try again.
  
  In the Edit Contact view, or when trying to import a record with a phone number, we get this error message:
  
  Sorry but we are not able to provide this at the moment.
    DB Error: unknown error
    Return to home page.
  
  Log is below, and seems to suggest it has something to do with stripping non-integer characters from the field. However, adding a phone number without any dashes 5554443333 also produces the error. Any ideas?
  
  Jul 02 12:28:40  [info] $Fatal Error Details = Array
    (
        [callback] => Array
            (
                [0] => CRM_Core_Error
                [1] => handle
            )
  [code] => -1
  [message] => DB Error: unknown error
  [mode] => 16
  [debug_info] => 
  CREATE FUNCTION civicrm_strip_non_numeric(input VARCHAR(255) CHARACTER SET utf8)
    RETURNS VARCHAR(255) CHARACTER SET utf8
    DETERMINISTIC
    NO SQL
  BEGIN
    DECLARE output   VARCHAR(255) CHARACTER SET utf8 DEFAULT '';
    DECLARE iterator INT          DEFAULT 1;
    WHILE iterator < (LENGTH(input) + 1) DO
      IF SUBSTRING(input, iterator, 1) IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9') THEN
        SET output = CONCAT(output, SUBSTRING(input, iterator, 1));
      END IF;
      SET iterator = iterator + 1;
    END WHILE;
    RETURN output;
  END [nativecode=1419 ** You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)]
  [type] => DB_Error
  [user_info] => 
  CREATE FUNCTION civicrm_strip_non_numeric(input VARCHAR(255) CHARACTER SET utf8)
    RETURNS VARCHAR(255) CHARACTER SET utf8
    DETERMINISTIC
    NO SQL
  BEGIN
    DECLARE output   VARCHAR(255) CHARACTER SET utf8 DEFAULT '';
    DECLARE iterator INT          DEFAULT 1;
    WHILE iterator < (LENGTH(input) + 1) DO
      IF SUBSTRING(input, iterator, 1) IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9') THEN
        SET output = CONCAT(output, SUBSTRING(input, iterator, 1));
      END IF;
      SET iterator = iterator + 1;
    END WHILE;
    RETURN output;
  END [nativecode=1419 ** You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)]
  [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="
  CREATE FUNCTION civicrm_strip_non_numeric(input VARCHAR(255) CHARACTER SET utf8)
    RETURNS VARCHAR(255) CHARACTER SET utf8
    DETERMINISTIC
    NO SQL
  BEGIN
    DECLARE output   VARCHAR(255) CHARACTER SET utf8 DEFAULT '';
    DECLARE iterator INT          DEFAULT 1;
    WHILE iterator < (LENGTH(input) + 1) DO
      IF SUBSTRING(input, iterator, 1) IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9') THEN
        SET output = CONCAT(output, SUBSTRING(input, iterator, 1));
      END IF;
      SET iterator = iterator + 1;
    END WHILE;
    RETURN output;
  END [nativecode=1419 ** You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)]"]
  
  )
  
  **Tags:** contacts, phone
  
  
  ---
  
  ## 5 answers
  
  ### Answer by username_0 on 2015-08-21. Score: 1 | Accepted answer
  
  Not sure what the problem was, but it seems to have related to our host. We've switched hosts and the problem is solved.
  
  
  ---
  
  ### Answer by username_1 on 2015-07-03. Score: 2
  
  Your error log says:
  
  > \*\* You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log\_bin\_trust\_function\_creators variable)]
  
  If you turn off logging at **Administer > System settings > Misc (Undelete, PDFs, Limits, Logging, Captcha, etc.)** can you save phone numbers?
  
  You can find information on the MySQL privileges needed for CiviCRM at <http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+MySQL+Permission+Requirements>
  
  Not all hosting companies provide these privileges without a specific request to do so (and even then some will refuse to do so).
  
  > **Comments:**
  > **username_0**: Not sure why it says binary logging is enabled, because it is not, according to the misc settings panel. This log is from an instance when I had turned debugging on. Does that automatically enable binary logging? Even if it does, the phone number problem was occurring before that.  
  
  ---
  
  ### Answer by username_2 on 2015-11-10. Score: 2
  
  I spent hours trying to fix this probably-same problem. I could edit other contact fields, but phone number always choked.
  
  What finally fixed it for me:
  
  > $ mysql\_upgrade -u root -p
  
  The key clue was a mention of "mysql.proc" in a backtrace, which led to a mysql forum. Apparently, you're supposed to run that command whenever you upgrade mysql.
  
  > **Comments:**
  > **username_0**: Don't know if that would have solved my problem, since our server change fixed it, but thanks for your answer!  
  
  ---
  
  ### Answer by username_3 on 2017-12-15. Score: 1
  
  For Joomla users, the file located at
  /administrator/components/com_civicrm/civicrm/CRM/Contact/BAO/Contact.php requires a semicolon at line 42:
  const DROP_STRIP_FUNCTION_43 = "DROP FUNCTION IF EXISTS civicrm_strip_non_numeric;";
  
  I hope this helps.
  
  
  ---
  
  ### Answer by username_4 on 2022-02-15. Score: 1
  
  I had this same problem, caused when DreamHost upgraded from MySQL 5.7 to 8. Trigger functions aren't supported anymore unless you pay an extra $15/mo for MySQL VPS. For details on my problem see: <https://chat.civicrm.org/civicrm/pl/75p1thb8w3fq9gx9rwsirphy6a>
  I'm going to look into CiviHosting.com
  
  
  ---
  
  