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
0
votes
0 answers

Getting some syntax error while trying to create event

I am trying to create an event and its Do part I am inserting one row but before inserting it ... for its one column i am trying getting value from a select query and then trying to add that in insert query . can some one tell me ... what is wrong…
sonu
  • 1
  • 3
0
votes
1 answer

Check for changes in MySQL, node.js

How can I, in this code, take the data that has been changed in MYSQL and return it in another function? For example, take the id_ticket column and use it in another function. const instance = new MySQLEvents(connection, { startAtEnd:…
0
votes
0 answers

MySQL event with multiple deletes

I need to create an MySQL event with multiple deletes. Content of the event : delete cfc_registration from cfc_registration inner join cfc_tournament where cfc_registration.cfcTournamentId = cfc_tournament.id and cfc_tournament.createdAt >=…
tonymx227
  • 5,293
  • 16
  • 48
  • 91
0
votes
0 answers

MySQL code works as SQL statement but not in Events

Afternoon, I am trying to figure out why this code would work as a standalone SQL statement but does not work in the "Events" tab - Using PhpMyAdmin to set up an event, first time attempting this so probably a very easy answer, excuse my simple…
Dan W
  • 365
  • 1
  • 4
  • 20
0
votes
1 answer

MySql Event to Delete Data from 2 Tables Older Than 2 Months

Im new to MySql events and I never used them before so please to bear with me. With My DB I have order_details and invoices tables which I need to create an Event to delete all the records older than 2 months and where order_details status = 5 and…
Mohammed Riyadh
  • 883
  • 3
  • 11
  • 34
0
votes
0 answers

How to edit MySQL event with invalid name?

I have an event named nolin_kuota_prioritas_JKT-TGS-pagi. I wanted to disable it, but MySQL Workbench said Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to…
0
votes
2 answers

Creating an event inside a mysqlstored procedure

can we create an event inside MySQL stored procedure? i tried creating event scheduler inside MySQL stored procedure ,but event is not created
0
votes
1 answer

how to solve Access denied; you need (at least one of) the SUPER privilege(s) for this operation in mysql

Any idea on the solution? SQL query: SET GLOBAL event_scheduler="ON" MySQL said: Documentation #1227 - Access denied; you need (at least one of) the SUPER privilege(s) for this operation I am trying to SET GLOBAL…
vsol
  • 97
  • 2
  • 10
0
votes
1 answer

Schedule event to change column in mysql

I need to change the status column depending on other two columns which are dates. | id | start | end | status | | 1 | 2020-04-23 | 2020-04-28 | inprogress| -->current date is > than start date and < than end date | 2 | 2020-02-20 |…
0
votes
0 answers

MySQL Event Schedule Datediff

When i try to execute this SQL, i got an error, bellow : SQL Query : CREATE EVENT fine ON SCHEDULE EVERY 1 DAY DO if datediff(CURRENT_DATE,transactions.return_date) > 0 UPDATE transactions SET fine = fine + 1000 end if ERROR : #1054 - Unknown…
mrobbizulfikar
  • 461
  • 5
  • 14
0
votes
1 answer

MySQL event time scheduled one hour less than CURRENT_TIMESTAMP

I'm trying to schedule a MySQL EVENT with the following instructions: CREATE EVENT IF NOT EXISTS test_event ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 MINUTE but the event is scheduled one hour less than CURRENT_TIMESTAMP. The command: SELECT…
Manticore
  • 309
  • 2
  • 13
0
votes
1 answer

Create event in mysql with a query?

I want to create an event in mysql, but want to add the sum and accumulated query that I put in the description This is the event code, but I'm not sure how to do it: CREATE EVENT `recurring data` ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1…
0
votes
0 answers

MySQL event not working (insert statement)

I am using PHP to execute the SQL query, the event can be created but no random data is inserted into the database. The global event scheduler is set on. Is there anything wrong with my code? What I try to do is to insert random data into the…
0
votes
2 answers

Declare variable MySQL trigger and create table using that variable

I have a event in which I am storing a string in a variable. Now I want to use that variable to create a new table. Everytime my event runs it creates table with the name of "mon". What is I am doing wrong ? BEGIN DECLARE onlyweek INT; DECLARE mon…
hammer
  • 82
  • 10
0
votes
1 answer

How to preform multiple DELETE queries in an event MySQL 8

I am trying to delete rows after a certain period of time, using an event. When doing this I have other things to take care of.. I only want to delete rows if they want to be deleted after a certain amount of time. Don't really know how to phrase…
dobson
  • 461
  • 6
  • 14