Unable to create triggers in GCP cloud MySQL

I am trying to create triggers in cloud MySQL and facing the below error.

ERROR 1419 (HY000): 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)

Tried to set the global variable also but I getting superuser missing privileges.

SET GLOBAL log_bin_trust_function_creators = 1;

ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER privilege(s) for this operation

How to create the trigger in this case?


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

You will need to either use the Google Cloud Console GUI or the CLI gcloud to set database flags.

Google Cloud Console GUI:

  • Open the Cloud SQL instance and click Edit.
  • Scroll down to the Flags section.
  • To set a flag that has not been set on the instance before, click Add item, – choose the flag from the drop-down menu, and set its value.
  • Click Save to save your changes.
    Confirm your changes under Flags on the Overview page.

Using the CLI:

gcloud sql instances patch [INSTANCE_NAME] 
  --database-flags log_bin_trust_function_creators=on

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x