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
1
vote
0 answers

MySQL Procedure / Event did not finish executing. Took just about 30 mins

So we have a database server (MySQL) that has 40 databases (20 database As and 20 database Bs). The As are named db_a_01, db_a_02.. and so on (Bs are db_b_01.. and so on). The As have the same structure and so have the Bs, but the As and the Bs have…
xtan
  • 41
  • 1
  • 3
1
vote
1 answer

Error with MySQL syntax in event sql-script. Delimeter already used

I have this script for update table monthly: DELIMITER | CREATE EVENT `kpiparams_scheduled_update` ON SCHEDULE EVERY 1 MONTH STARTS '2020-02-01 02:59:59' ON COMPLETION PRESERVE COMMENT 'KPIParams was updated by…
Mykola
  • 118
  • 1
  • 14
1
vote
2 answers

How to create a stored procedure and run it on a scheduled time (in MYSQL)

Need your expertise, I have a script in MySQL and I want it to create a stored procedure and run it on a scheduled time (let's say I need to run it on 7 am and 1 pm). sample script: update systemuser set defaultSiteCode =(select siteCode from site…
1
vote
1 answer

How to write a MySQL event script

How can I create a MySQL event that can be run every 10 minutes and update the table based on TIMESTAMP column? I have a table like: Now I need to have a My SQL event which can loop to the table and update all pending from 1 to 0 IF/WHERE Date is…
Behseini
  • 6,066
  • 23
  • 78
  • 125
1
vote
0 answers

How to execute multiple queries in an MySQL event

So, I am creating an event on mySQL which if 5 days passed from transaction date, the status of transaction will be cancelled and the reservation will return and so forth. Here's my code so far: CREATE EVENT cancel_transaction_event ON SCHEDULE …
Cheryl Blossom
  • 185
  • 1
  • 13
1
vote
0 answers

MySQL Event Scheduler: Archive data older than 1 day

i have a table with the latest currency rates, and i created another table as archive for the currency rates, and i want to firstly insert all rows that are older than 1 month to the archive and then delete it from the latest currency rates table. I…
erimeri
  • 181
  • 1
  • 3
  • 17
1
vote
1 answer

Start Transaction causes an error when creating an event in phpMyAdmin

For whatever reason, phpMyAdmin won't allow me to create an event with Start transaction. This is what I'm using: CREATE EVENT `set_history` ON SCHEDULE EVERY 1 DAY STARTS '2018-9-29 00:00:00' ON COMPLETION PRESERVE DISABLE ON SLAVE DO BEGIN …
Todd G
  • 33
  • 1
  • 7
1
vote
0 answers

MYSQL event shows an error "Sorry an unexpected error happened!"

I have this MYSQL EVENT which I can't understand why it not works. It shows me an error saying "Sorry an unexpected error happened!" on phpmyadmin when I'm trying to execute it. Please someone tell me what is wrong with this code. DELIMITER…
ashen25
  • 29
  • 7
1
vote
1 answer

Drop all events using single query in mysql 8

Is there any possibilities to drop all events using single query ? I know, we can get list of events using show events and drop single event with there name. I also did google for it.but no where showing appopriate solution for it. Anyone have some…
Deep Patel
  • 101
  • 1
  • 2
  • 10
1
vote
0 answers

MySQL script with event scheduler before spring boot app starts

In my app I creating tables with Hibernate annotations, but after this I want to create mysql script to generate raports: In my resources folder I created data.sql : DROP EVENT IF EXISTS daily_report; DELIMITER $$ CREATE EVENT daily_report ON…
Adam
  • 151
  • 1
  • 2
  • 14
1
vote
1 answer

MySQL event weekly but only first week every month?

I need to run an event weekly (every 1st Friday of the month) and another event every Friday other than the first Friday of the month. All I could think of was something like IF WEEKDAY()=4 AND DAYOFMONTH() BETWEEN 1 AND 7 THEN .... and IF…
popkutt
  • 949
  • 3
  • 10
  • 19
1
vote
2 answers

MySQL renaming and create table at the same time

I need to rename MySQL table and create a new MySQL table at the same time. There is critical live table with large number of records. master_table is always inserted records from scripts. Need to backup the master table and create a another…
Sathiska
  • 495
  • 1
  • 6
  • 22
1
vote
1 answer

Mysql creating an Event that updates something every monday, friday and sunday for ever

Do you guys have any idea of how to do this in Mysql?? to Create only one event without using 'IF' that happens how many days i want forever? Ex: an Event that happens every mondey, friday and sunday!
matmany
  • 151
  • 1
  • 6
1
vote
1 answer

MySQL query not working in phpMyAdmin Event Scheduler

I'm trying to run a query: SET @Curr_Weekday := DAYOFWEEK(CURRENT_DATE); INSERT INTO daily_calibrations (`calibration_date`, `machine_ID`) SELECT * FROM ( SELECT CURRENT_DATE, 37 FROM dual UNION ALL SELECT CURRENT_DATE, 38 FROM dual UNION…
1
vote
0 answers

mysql push notification

Reading that MySQL doesn't have similar to SqlDependency. What is the best snippet to notify other users if a cell changed? Most of the current posts suggest pooling as recommended approach but can't find proper code to study for VB.NET Winform…
wpcoder
  • 1,016
  • 11
  • 17