Answers.Body: <p>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</p>
  
  <pre><code>DROP FUNCTION `civicrm_strip_non_numeric`
  </code></pre>
  
  <p>An alternative is to use the checkbox in <em>phpmyadmin</em> that is labeled <em>add DROP TABLE / VIEW / PROCEDURE / FUNCTION</em></p>
  
  <p>(To be honest: I am not a phpmyadmin user, I got this suggestion from <a href="https://stackoverflow.com/questions/2760460/what-does-the-add-drop-table-view-procedure-function-checkbox-do-in-php">What does the “Add DROP TABLE / VIEW / PROCEDURE / FUNCTION” checkbox do in phpmyadmin</a> ).</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-16T20:01:38.663Z
Answers.Text: 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...
Answers.UserDisplayName: puck
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-16T19:33:01.003Z
Answers.LastActivityDate: 2016-11-16T19:33:01.003Z
Answers.LastEditDate: 2017-05-23T12:38:59.763Z
Answers.UserDisplayName: Kainuk - CiviCooP
Body: <p>I follow the instructions here <a href="https://wiki.civicrm.org/confluence/display/CRMDOC/Moving+the+database+using+phpMyAdmin" rel="nofollow noreferrer">https://wiki.civicrm.org/confluence/display/CRMDOC/Moving+the+database+using+phpMyAdmin</a></p>
  
  <p>I want to import the so called Old_without_five_tables.sql with phpmyadmin in the civicrm database but I get the following error:</p>
  
  <p>SQL query:</p>
  
  <pre><code>- 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 &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$$
  </code></pre>
  
  <p>MySQL said: </p>
  
  <blockquote>
    <p>#1304 - FUNCTION civicrm_strip_non_numeric already exists </p>
  </blockquote>
  
  <p>I am using:
  civicrm 4.7.3
  drupal 7.26</p>
  
  <p>thanks so far</p>
  
Tags: <drupal><database><error><mysql>
Title: Transfer Database to new location raised MySQL Error function already exists
ThreadText: # Transfer Database to new location raised MySQL Error function already exists
  
  (Asked by: username_0 on 2016-11-16)
  
  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
  
  **Tags:** drupal, database, error, mysql
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-11-16. Score: 2 | Accepted answer
  
  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](https://stackoverflow.com/questions/2760460/what-does-the-add-drop-table-view-procedure-function-checkbox-do-in-php) ).
  
  > **Comments:**
  > **username_0**: 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...  
  
  ---
  
  