For a Google CloudSQL 2nd generation instance, with Failover replication was enabled. After that when tried to import the database it is not allowing to create the procedure. Receiving below error.
Error Code: 1419. You do not have the SUPER privilege and binary logging is enabled (you might want to use the less safe log_bin_trust_function_creators variable)
Is it true that CloudSQL with failover will not support function ?
Sample execute query
DELIMITER ;;
CREATE FUNCTION `stutzen`(amount INT) RETURNS int(11)
DETERMINISTIC
BEGIN
DECLARE charges FLOAT DEFAULT 1.0;
SELECT valuesettings INTO charges FROM dreamer_tbl WHERE namesettings='stutzen.co';
RETURN FLOOR((amount / 100) * charges) ;
END ;;
DELIMITER ;
You just need to set 'log_bin_trust_function_creators' to ON
To do it, open https://console.cloud.google.com
Select SQL
Select your instance
Select EDIT
DB signals
Add: log_bin_trust_function_creators on
general_log on
SAVE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With