简体   繁体   English

如何在 Google Cloud SQL 中启用 Mysql 事件调度程序?

[英]How to enable Mysql Event Scheduler in Google Cloud SQL?

I have a somewhat restricted access to a Mysql instance in Google Cloud.我对 Google Cloud 中的 Mysql 实例的访问有些受限。 There, I need to run two scheduled events (call a procedure) every few minutes and once a day at a fixed time.在那里,我需要每隔几分钟和每天一次在固定时间运行两个预定事件(调用一个程序)。 However, I am unable to enable the event scheduler, nor could the instance owner.但是,我无法启用事件调度程序,实例所有者也无法启用。 Can anyone please guide me to effectively enable the event scheduler?谁能指导我有效地启用事件调度程序? Or, is there any other way around this from within the DBMS?或者,在 DBMS 中有没有其他方法可以解决这个问题?

SHOW VARIABLES where Variable_name like '%sched%';

shows |event_scheduler|OFF|显示 |event_scheduler|OFF| |:-------------:|:-:| |:-------------:|:-:|

When the instance owner tries to turn it ON,当实例所有者尝试打开它时,

SET GLOBAL event_scheduler = ON;

says SQL Error [1227] [42000]: Access denied; you need (at least one of) the SUPER privilege(s) for this operationSQL Error [1227] [42000]: Access denied; you need (at least one of) the SUPER privilege(s) for this operation SQL Error [1227] [42000]: Access denied; you need (at least one of) the SUPER privilege(s) for this operation

Mysql version 5.7 Mysql 5.7版

MySQL operations that require Super privileges are not supported under Cloud SQL. Cloud SQL 不支持需要超级权限的 MySQL 操作。 Check this documented inCloud SQL FAQ .查看Cloud SQL FAQ中记录的内容。
As an alternative way, you can enable the Event Scheduler via your Google Cloud Platform Console.作为替代方法,您可以通过 Google Cloud Platform Console 启用事件调度程序。
Please go to your Cloud Console > SQL > Choose your SQL instance > Instance details: Edit> Flags> Add Flag> Choose event_scheduler > On > Save.请 go 到您的云控制台 > SQL > 选择您的 SQL 实例 > 实例详细信息:编辑 > 标志 > 添加标志 > 选择 event_scheduler。
For more information and options about setting database flags in MySQL,check Setting Database flag document.有关在 MySQL 中设置数据库标志的更多信息和选项,请查看设置数据库标志文档。

Also, you could use the cron service from App Engine to trigger the stored procedures through setting up and configuring your App Engine environment.此外,您可以使用 App Engine 中的 cron 服务通过设置和配置 App Engine 环境来触发存储过程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在谷歌云 sql 服务器中启用 CDC 以进行 AWS DMS 复制? - how to enable CDC in google cloud sql server for AWS DMS replication? 如何通过谷歌云调度程序调用我的应用程序 api - How to call my app api through google cloud scheduler 如何在 Google Cloud 上正确启用 extension=imagick.so - How proper enable extension=imagick.so on Google Cloud 如何在 MySQL Workbench 中使用 REGEXP_SUBSTR 或 REGEXP_EXTRACT 以及托管在 Google Cloud SQL 上的数据库? - How to use REGEXP_SUBSTR or REGEXP_EXTRACT in MySQL Workbench with database hosted on Google Cloud SQL? 在 Google Cloud 项目上启用结算功能 - Enable Billing on the Google Cloud Project 谷歌云功能启用 CORS? - Google Cloud Functions enable CORS? Google Cloud Composer 单调度程序与多调度程序 - Google Cloud Composer single vs multiple scheduler 如何在不重启数据库实例的情况下截断 Google Cloud SQL 中的 MySQL performance_schema? - How to truncate the MySQL performance_schema in Google Cloud SQL without restarting DB instance? 在其他项目上创建 Google 云 SQL MySQL 只读副本 - Create Google cloud SQL MySQL read replica on a different project 如何更改 Google Cloud SQL 中的日期样式? - How to change datestyle in Google Cloud SQL?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM