2

I follow the instructions here https://wiki.civicrm.org/confluence/display/CRMDOC/Moving+the+database+using+phpMyAdmin

I want to import the so called Old_without_five_tables.sql with phpmyadmin in the civicrm database but I get the following error:

SQL query:

- Datenbank: `civicrm`
--

DELIMITER $$
--
-- Funktionen
--
CREATE DEFINER=`civicrm`@`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$$

MySQL said:

#1304 - FUNCTION civicrm_strip_non_numeric already exists

I am using: civicrm 4.7.3 drupal 7.26

thanks so far

2

The error suggests that you did run the import for the second time. The function cannot be created because it is already there. You can remove it with

DROP FUNCTION `civicrm_strip_non_numeric`

An alternative is to use the checkbox in phpmyadmin that is labeled add DROP TABLE / VIEW / PROCEDURE / FUNCTION

(To be honest: I am not a phpmyadmin user, I got this suggestion from What does the “Add DROP TABLE / VIEW / PROCEDURE / FUNCTION” checkbox do in phpmyadmin ).

  • Thanks this worked out and i can see all contacts. Just a short remark in the linked explaination (in my question) you should create a constraint.sql, i just skipped this step and it worked... – puck Nov 16 '16 at 20:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.