title: Creating functions in phpMyAdmin - Error: access denied you need the super privilege for this operation
body: <p>I imported a MySQL database. All the tables where successfully imported but not the functions. The only way I can execute SQL queries is through phpMyAdmin or with a PHP script (no SSH).</p>
  
  <p>Here's an example of the functions to import:</p>
  
  <pre><code>DELIMITER ;;
  /*!50003 DROP FUNCTION IF EXISTS `f_calc_gst` */;;
  /*!50003 SET SESSION SQL_MODE=""*/;;
  /*!50003 CREATE*/ /*!50020 DEFINER=`journal`@`%`*/ /*!50003 FUNCTION `f_calc_gst`(p_ht decimal(15,3), p_province varchar(2)) RETURNS varchar(255) CHARSET utf8
  begin
    declare res varchar(255); 
    declare v_gst decimal(15,3);
    declare v_gst_formula varchar(255);
  
    select GST, GST_formula
    into v_gst, v_gst_formula
    from taxes_periods
    where NOW() between dt_debut and dt_fin
    and id_province = p_province;
  
    set v_gst_formula = replace(v_gst_formula, 'HT$', p_ht);
    set v_gst_formula = replace(v_gst_formula, 'GST%', v_gst);
  
    set res = concat('select round(', v_gst_formula, ',2) "gst"');
    return res;
  end */;;
  </code></pre>
  
  <p>If I paste this code in phpMyAdmin I get this error: <em>#1227 - Access denied; you need the SUPER privilege for this operation</em> </p>
  
  <p>I tried removing the "/<em>!50003" and the "</em>/" to uncomment the SQL but I get the same error message.</p>
  
  <p>I also tried not using any delimitors and removing "DELIMITER ;;" and got this error: </p>
  
  <pre><code>DROP FUNCTION IF EXISTS f_calc_gst SET SESSION SQL_MODE =  "" CREATE DEFINER =  `journal`@`%` FUNCTION  `f_calc_gst` (
  
  p_ht DECIMAL( 15, 3 ) ,
  p_province VARCHAR( 2 )
  ) RETURNS VARCHAR( 255 ) CHARSET utf8 BEGIN declare res VARCHAR( 255 ) ;
  
  #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET SESSION SQL_MODE=""
  CREATE DEFINER=`journal`@`%` FUNCTION `f_calc_gst`(p_ht ' at line 2
  </code></pre>
  
  <p>Also tried :</p>
  
  <pre><code>    CREATE DEFINER=`journal`@`%` FUNCTION `f_calc_gst`(p_ht decimal(15,3), p_province varchar(2)) RETURNS varchar(255) CHARSET utf8
  begin
    declare res varchar(255); 
    declare v_gst decimal(15,3);
    declare v_gst_formula varchar(255);
  
    select GST, GST_formula
    into v_gst, v_gst_formula
    from taxes_periods
    where NOW() between dt_debut and dt_fin
    and id_province = p_province;
  
    set v_gst_formula = replace(v_gst_formula, 'HT$', p_ht);
    set v_gst_formula = replace(v_gst_formula, 'GST%', v_gst);
  
    set res = concat('select round(', v_gst_formula, ',2) "gst"');
    return res;
  end//
  </code></pre>
  
  <p>resulting in :</p>
  
  <pre><code>#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3 
  </code></pre>
  
  <p>Is the problem in the SQL, phpMyAdmin or with the server?</p>