CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • MySQL permissions error restore w/ FUNCTION `civicrm_strip_non_numeric`
Pages: [1]

Author Topic: MySQL permissions error restore w/ FUNCTION `civicrm_strip_non_numeric`  (Read 627 times)

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
MySQL permissions error restore w/ FUNCTION `civicrm_strip_non_numeric`
April 03, 2014, 10:31:36 am
After a failed upgrade I deleted the database, re-created it, assigned the 'master' user to it (that has all permissions) and imported the .sql backup file.  I got this error:
Code: [Select]
ERROR 1227 (42000) Access denied; you need (at least one of) the SUPER privilege(s) for this operation
When I removed this code from the bottom of the .sql the import went fine.
Code: [Select]
CREATE DEFINER=`mymasteruser`@`localhost` FUNCTION `civicrm_strip_non_numeric`(input VARCHAR(255) CHARACTER SET utf8) RETURNS varchar(255) CHARSET utf8
    NO SQL
    DETERMINISTIC
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

Any thoughts on what permission I am missing or why this is happening?
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: MySQL permissions error restore w/ FUNCTION `civicrm_strip_non_numeric`
April 03, 2014, 11:02:36 am
I think in older versions of mysql you needed SUPER privileges to create functions. Might want to look it up in mysql docs.
Try asking your question on the new CiviCRM help site.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • MySQL permissions error restore w/ FUNCTION `civicrm_strip_non_numeric`

This forum was archived on 2017-11-26.