【问题标题】:Unable to create triggers in GCP cloud MySQL无法在 GCP 云 MySQL 中创建触发器
【发布时间】:2021-07-13 06:25:11
【问题描述】:

我正在尝试在云 MySQL 中创建触发器并遇到以下错误。

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)

也尝试设置全局变量,但超级用户缺少权限。

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

这种情况下如何创建触发器?

【问题讨论】:

    标签: mysql google-cloud-platform google-cloud-sql


    【解决方案1】:
    推荐的答案 Google Cloud

    您需要使用 Google Cloud Console GUI 或 CLI gcloud 来设置数据库标志。

    Google 云端控制台 GUI:

    • 打开 Cloud SQL 实例并点击编辑。
    • 向下滚动到标志部分。
    • 要设置以前未在实例上设置的标志,请单击添加项,- 从下拉菜单中选择标志,然后设置其值。
    • 单击保存以保存您的更改。 在概览页面的标志下确认您的更改。

    使用 CLI:

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

    【讨论】:

      猜你喜欢
      • 2013-12-12
      • 2018-05-16
      • 2018-07-15
      • 1970-01-01
      • 2016-01-25
      • 2020-11-22
      • 2013-05-30
      • 1970-01-01
      • 2017-08-27
      相关资源
      最近更新 更多