Skip to main content
Help Center
The GoDaddy Community will undergo maintenance starting on Tuesday, August 3rd at 3pm PST / 6pm EST. Learn more
  • GoDaddy Community
  • VPS & Dedicated Servers
  • VPS & Dedicated Servers

    cancel
    Showing results for 
    Show  only  | Search instead for 
    Did you mean: 
    Flyfish
    New

    Mysql create a function

    Hi,

     

    try to create a function like below in mysql:

     

    DROP FUNCTION IF EXISTS `GetRandomSentence`;
    CREATE FUNCTION `GetRandomSentence`(`MaxWordCount` INT, `MaxWordCharacters` INT) RETURNS text CHARSET utf8
    DETERMINISTIC
    BEGIN

    **************

    END WHILE;

    RETURN randomSentence;
    END;

     

     

    --

     

     

    it says that I have no super user privileges. So how can I create a function?

    3 REPLIES 3
    GaryA
    Moderator

    Hi @Flyfish, thanks for posting.

    If you are using a shared or web hosting plan, functions that require super user privileges would be unavailable. You would want to edit the function to not require super user privileges or use an alternate method.

    ^Gary

    Gary - GoDaddy | Community Moderator
    24/7 Support | Check System Status

    Hi @GaryA,

    I have the same question about create routines and triggers in MySql database. If I don't have privileges to create routines and triggers, how can I host my website here? MySql error #1419 says that I *might* want to use less safe mode by setting bin_log_trust_function_creator to 1, but again, I don't have SUPER privilege to modify the flag. So how this issue be solved?

     

    Thank you for your help!

    @robbsj

    Hi @robbsj.

    If your site requires permissions or access to functions that are not supported on the Web Hosting, then your site might not be compatible with it. You may want to consider using a VPS, so that you have more control over the permissions of your server and account.

    ^Gary

    Gary - GoDaddy | Community Moderator
    24/7 Support | Check System Status