2nd generation sql cloud triggers

I am trying to populate a 2nd generation sql cloud instance (v5.7) with a database dump that is currently running on the first generation SQL cloud. It has several triggers:

    /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`%`*/ /*!50003 TRIGGER `resourcetypetransaction_AFTER_INSERT` AFTER INSERT ON `resourcetypetransaction` FOR EACH ROW
  BEGIN
    INSERT INTO `resourcetypetransactionlog` SELECT *
                                             FROM `resourcetypetransaction`
                                             WHERE id = NEW.id;
  END */;;

The result when inserting the database into the 2nd gene:

shinkansen:sql ameyer$ cat gae_2016-08-30T08\:21\:33.sql | mysql -u root -pxxxx -h xxxx napoleon;
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1419 (HY000) at line 1067: 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 there a way to enable triggers like this in the 2nd gene?

Cheers andres

+4
source share
3 answers

Because some triggers can produce conflicting results when replication is enabled, they are not allowed in the default configuration.

You have two options:

+6

, , , , Google Cloud SQL .

  • : Instances

  • . ( ).

  • , "Marcas de Cloud SQL".

  • ON.

    log_bin_trust_function_creators -> ON

  • Cloud Shell. ( , , google " mysql "

2- Cloud SQL

+3

I had the same problem. What about the next operation? 1. Download the exported .sql file to Cloud Strage 2. Connect to Cloud SQL as root on CLI 3. import (for example, source xxx.sql). He worked well.

0
source

Source: https://habr.com/ru/post/1652953/


All Articles