DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled

后端 未结 6 1344
抹茶落季
抹茶落季 2020-12-04 07:24

While importing the database in mysql, I have got following error:

1418 (HY000) at line 10185: This function has none of DETERMINISTIC, NO SQL, or READS SQL DA

6条回答
  •  执念已碎
    2020-12-04 07:33

    Try setting the definer for the function!

    So instead of

    CREATE FUNCTION get_pet_owner

    you will write something akin to

    CREATE DEFINER=procadmin@% FUNCTION get_pet_owner

    which ought to work if the user prodacmin has rights to create functions/procedures.

    In my case the function worked when generated through MySQL Workbench but did not work when run directly as an SQL script. Making the changes above fixed the problem.

提交回复
热议问题