Error Code: 1418的解决方案

    技术2022-05-20  40

    Error Code: 1418This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)

     

    1,set global log_bin_trust_function_creators=TRUE;   优点:不用重启数据库,就解决问题了,直接可以使用function了。  缺点:一重启数据库,就又要执行一次,否则下次function你就用不了。

    2,在/etc/my.cnf的【mysqld】后面 添加 log_bin_trust_function_creators=true,然后重启mysql数据库。  优点:一劳永逸,解决问题。  缺点:需要重启数据库,生产库上,如果业务不允许重启,那么你就只有选择第一种方案了。


    最新回复(0)