Questions tagged [mysql-event]

The MySQL Event Scheduler manages the scheduling and execution of events: Tasks that run according to schedule. Event support was added in MySQL 5.1.6.

The MySQL Event Scheduler manages the scheduling and execution of events: Tasks that run according to schedule. Event support was added in MySQL 5.1.6.

163 questions
3
votes
0 answers

Event scheduler in Waiting for next activation state for long time

I created an event and now when use SHOW PROCESSLIST command on my MyQLWorkbench window, I see the following message for my event.Please see the following Image: The above fields in the image corresponds to Id,Host,db,Command,time,State,Info…
John
  • 1,210
  • 5
  • 23
  • 51
2
votes
1 answer

MySQL CREATE EVENT wrong syntax

Edit: I've figured out my MySQL version doesn't support it. I run 5.0.91, it requires 5.1 or so. I'm assuming the syntax is correct. Thanks for the help. I've just created this mysql event that's supposed to be run every hour. However, I keep…
Patrickdev
  • 2,341
  • 1
  • 21
  • 29
2
votes
1 answer

how to emit data from mysql server to node.js socket.io

So I've been banging my head against the wall for a bit now, I am trying to listen for events from the @rodrigogs/my-sql events node package, and emit those events through socket-io to the react client. however there seems to be a disconnect I can't…
altruios
  • 986
  • 1
  • 10
  • 29
2
votes
1 answer

How to CREATE EVENT from Stored Procedure with a random event name?

I want to EXEC from MySQL Stored Procedure a CREATE EVENT sql. I cannot use PREPARE because CREATE EVENT is not allowed in PREPARE, and I want to use a random name, as I need to create a unique event, and I need to pass some date params in the DO…
Pentium10
  • 204,586
  • 122
  • 423
  • 502
2
votes
1 answer

Why does MySQL 5.7 Even Scheduler START datetime not match with the CREATE/ALTER EVENT START time?

After I create the event... DELIMITER $$ CREATE DEFINER=`abc`@`localhost` EVENT `testEventYearly` ON SCHEDULE EVERY 1 YEAR STARTS '2018-01-01 00:00:00' ON COMPLETION PRESERVE ENABLE DO BEGIN CALL `spTestEventYearly` (); END$$ ...I look in the…
Brant Messenger
  • 1,441
  • 11
  • 21
2
votes
1 answer

listen mysql change event using zongji module not working

I am trying to listen mysql change event in my app using mysql-event module. For that I got to know that, i need to make sure if zongji module works fine. So here is what I have tried so far: --my server.js var ZongJi =…
undefined
  • 3,464
  • 11
  • 48
  • 90
2
votes
1 answer

Automatically Changing Each Value of a MySQl column

I have a column with numerous integer values. How can I code it so that every twenty-four hours each value is subtracted by one until it reaches 0? Till now, I have understood the code for repeating an event every 24 hours but could not find a way…
apaul
  • 308
  • 3
  • 13
2
votes
0 answers

Spring boot database listener with MYSQL

Is there any way to implement a database listener with Java using MySQL as database? Searching on Google I see that there are many solutions for Oracle with DatabaseChangeListener and DbChangeNotification, but nothing about MySQL... I need an…
Nammen8
  • 619
  • 1
  • 11
  • 31
2
votes
2 answers

Execute stored procedure every 1 day MySQL

I have to empty one of my tables from my database everyday at a certain hour (lets say 00:00:00). I have this in the procedure: CREATE DEFINER=`root`@`%` PROCEDURE `delete_day`() BEGIN TRUNCATE TABLE…
Cecilia
  • 29
  • 1
  • 1
  • 2
2
votes
2 answers

Creating a scheduled event in MySQL

I have a table names offer inside a MySQL database named fouras : mysql> desc offer; +------------------------+---------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra …
jemlifathi
  • 1,482
  • 5
  • 22
  • 32
2
votes
1 answer

How would you expire (or update) a MySQL record with precision to the expiry time?

Last year I was working on a project for university where one feature necessitated the expiry of records in the database with almost to-the-second precision (i.e. exactly x minutes/hours after creation). I say 'almost' because a few seconds probably…
Andre C
  • 457
  • 1
  • 9
  • 26
2
votes
0 answers

Will Mysql create new session for each event execution?

Not sure what session will be use for event execution. Will mysql always create new session or just reuse old while executing event ? what happens to user-defined variable ? what happen if different events use same user-defined variable( I know it…
Jammy Lee
  • 1,496
  • 1
  • 14
  • 32
2
votes
2 answers

How to select all tables with column name and update that column

I want to find all the tables in my db that contain the column name Foo, and update its value to 0, I was thinking something like this, but I don't know how to place the UPDATE on that code, I plan on having this statement on the Events inside the…
nonaxanon
  • 237
  • 4
  • 18
2
votes
0 answers

How to test MySQL event scheduler?

I created an event that runs once every week. I want to test this event, but of course, I don't want to wait the entire week. How can I test this event? Best practices?
vitorvigano
  • 697
  • 2
  • 8
  • 18
2
votes
1 answer

Not sure why mysql event is not running

My site has a video gallery in which only videos 2 weeks old or less should be displayed. Previously I was running a simple update query that ran whenever ANY user came to this page as follows: $unixtime = time(); $query = mysqli_query($cxn,…
1
2
3
10 11