触发云sql第2代

cpu*_*ter 7 google-cloud-sql

我正在尝试使用当前在第一代云SQL上运行的数据库转储来填充第二代云sql实例(v5.7).它有一些触发器:

    /*!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 */;;
Run Code Online (Sandbox Code Playgroud)

尝试将数据库插入第二代时的结果是:

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)
Run Code Online (Sandbox Code Playgroud)

有没有办法在第二代上启用这样的触发器?

干杯,安德烈斯

Vad*_*dim 11

由于某些触发器在启用复制时会产生不一致的结果,因此默认配置中不允许使用它们.

您有两种选择:


neg*_*o19 5

我遇到了同样的问题,在阅读了所有论坛之后,解决方案是从Google Cloud SQL而不是控制台在控制面板中设置变量。

  1. 在“实例”页面中输入:实例

  2. 选择您的实例并进行编辑。(单击三个点按钮)。

  3. 转到最后一个选项“ Marcas de Cloud SQL的标志”。

  4. 将变量置于ON状态。

    log_bin_trust_function_creators -> ON

  5. 我还必须等待几分钟,然后进入Cloud Shell。(我没有足够的声誉来输入链接,但是在Google中寻找“在Cloud Shell中使用mysql客户端”

第二代Cloud SQL