Is MySQL event scheduler available on Cloud SQL?

1,053 views
Skip to first unread message

Vivek

unread,
Jul 5, 2012, 3:05:07 AM7/5/12
to google-cloud...@googlegroups.com
I have application in MySQL. I want to migrate it to Cloud SQL. As per my current design i have schedule MySQL events to call some procedures. So I want to know can we create scheduler events on clod SQL for same reason.

Thanks,
Vivek

Razvan Musaloiu-E.

unread,
Jul 5, 2012, 3:34:08 AM7/5/12
to google-cloud...@googlegroups.com
A Cloud SQL instance is becomes passive if there is no traffic (FAQ) so even if you enable the event scheduler your event might not execute if the database happens to be in the passive mode. You could use the cron service from App Egine (python/java/go) to trigger the stored procedures though.

sql> create table t(i integer);
0 row(s) affected.
sql> create event test_insert on schedule every 1 minute do insert into test.t values(1);
0 row(s) affected.
sql> select * from test.t;
+-------------+
| i           |
+-------------+
|           1 |
+-------------+
1 row in set (0.16 sec)

sql> select * from test.t;
+-------------+
| i           |
+-------------+
|           1 |
+-------------+
1 row in set (0.16 sec)

sql> select * from test.t;
+-------------+
| i           |
+-------------+
|           1 |
+-------------+
1 row in set (0.16 sec)

sql> select * from test.t;
+-------------+
| i           |
+-------------+
|           1 |
|           1 |
+-------------+
2 rows in set (0.16 sec)

-- Razvan ME

Vivek

unread,
Jul 5, 2012, 4:32:01 AM7/5/12
to google-cloud...@googlegroups.com
Thanks Razvan for info,
I already tried the same thing with AppEngine cron jobs it works fine there. But on Cloud SQL I am not even able to create event, It throws
"Error 1235: This version of MySQL doesn't yet support 'embedded server' " Error. Do you have any idea about it?

-Vivek

Razvan Musaloiu-E.

unread,
Jul 5, 2012, 4:47:34 AM7/5/12
to google-cloud...@googlegroups.com
That error should go away soon. If you send me the name of your instance I can flip the bit right away (please do that off-the-list). :-)

-- Razvan ME

Indraneel Ganguli

unread,
Jun 15, 2016, 5:07:31 AM6/15/16
to Google Cloud SQL discuss
You can set mysql flag from console

event_scheduler
on

regards
Indraneel
Reply all
Reply to author
Forward
0 new messages