Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    [Solved] "CREATE DEFINER" issue in shared hosting

    General Discussion
    2
    3
    791
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      bagisto_noobie last edited by bagisto_noobie

      i just installed and ran bagisto in localhost and its working fine, but when i upload sql dump in cpanel (shared hosted) it throws following error

      CREATE DEFINER=`user`@`localhost` FUNCTION `get_url_path_of_category` (`categoryId` INT, `localeCode` VARCHAR(255)) RETURNS VARCHAR(255) CHARSET utf8mb4 BEGIN
      ------
      ------
      
      #1227 - Access denied; you need (at least one of) the SUPER privilege(s) for this operation
      

      table collation is also set to "utf8_unicode_ci"

      tried to grant super privilege but it is also not allowed by hosting, thows below error

      GRANT SUPER ON bagisto.* TO user@'localhost'
      MySQL said: Documentation
      
      #1045 - Access denied for user 'root'@'localhost' (using password: YES)
      

      removing the above function successfully uploads sql file but throws error while adding categories

      SQLSTATE[42000]: Syntax error or access violation: 1305 FUNCTION bagisto.get_url_path_of_category does not exist (SQL: update `categories` set `_lft` = case when `_lft` >= 19 then `_lft`+2 else `_lft` end, `_rgt` = case when `_rgt` >= 19 then `_rgt`+2 else `_rgt` end where (`_lft` >= 19 or `_rgt` >= 19))
      

      i dont have ssh access to the server, its a normal shared hosting
      is there a way i can run bagisto without stored procedure

      1 Reply Last reply Reply Quote 0
      • S
        simo.kassab last edited by

        Try to remove the DEFINER from your function like below:

        CREATE  FUNCTION `get_url_path_of_category` (`categoryId` INT, `localeCode` VARCHAR(255)) RETURNS VARCHAR(255) CHARSET utf8mb4 BEGIN
        
        
        1 Reply Last reply Reply Quote 1
        • B
          bagisto_noobie last edited by

          I was trying to remove the whole function. lol

          Removed the word "DEFINER" as you said and it works like a charm. Thanks 🙂

          1 Reply Last reply Reply Quote 0
          • First post
            Last post