8 Aug 2025

MySQL ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled

While restoring the MySQL dump, we may come across the following error 

ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled

 

 This happens because MySQL prevents function OR procedure creation in restore when binary logging is on.

 To avoid this, temporarily enable "Trust Function Creators" using below statement

mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 1;"
Do the restore
 [Do your restore]

Disable the flag again 

mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 0;"

No comments:

Post a Comment