Skip to main content

Questions tagged [mysql-event]

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.

Filter by
Sorted by
Tagged with
0 votes
1 answer
146 views

MariaDB event privileges/grants

I'm having multiple databases in MariaDB and I'm trying to set up an automation task, that would take data from one database/scheme and insert them with some transformation to another one. For this ...
kubisma1's user avatar
  • 111
0 votes
1 answer
200 views

MySQL event is not deleting rows

I've created a MySQL event to delete rows older than 3 years. I want this to run at 3 am every morning. MySQL version 5.5.61. CREATE EVENT event_clean_child_attendance ON SCHEDULE EVERY 1 DAY STARTS '...
Vincent's user avatar
  • 369
1 vote
0 answers
50 views

Replicating/Inserting 300M MYSQL records from 6 Remote Servers on Local using Unique Identifier

I have 6 remote servers that dial phone numbers daily. I have a total record count of over 300 million combined and now I want to procress on them. The table data looks like this using this query ...
Aun Zaidi's user avatar
2 votes
2 answers
1k views

MariaDB event to automatically move data older than a specific time to another table without temporary table?

I am trying to setup an event, that automatically moves data older than a specified amount of time from a heavily used table to some "archive" table to improve performance. So far I've only ...
Theo's user avatar
  • 135
0 votes
1 answer
183 views

MySQL - Information_schema Events - How persistent or retention is managed

I'm a MS SQL guy and understand agent job history. I'm now working with MySQL. I've searched hi and low but I can't find any solid info on how event data within information_schema.events is persisted, ...
Adam's user avatar
  • 113
0 votes
1 answer
393 views

MYSQL Delete event is not running

I have below database tables, Tables Definition A - order_dateils : id order_bar description payment_status created_at B - invoices : id invoice_id status created_at and created below event to ...
Ali Adil's user avatar
  • 113
12 votes
1 answer
27k views

MySQL event scheduler waiting on empty queue since server restarted 12 days ago

I noticed a process on the server which has been running for more than 12 days, which I think coincides with the last time MySQL was restarted. mysql> SHOW FULL PROCESSLIST; +---------+------------...
BadHorsie's user avatar
  • 223
1 vote
1 answer
2k views

MySql Event to Delete Data from 2 Tables Older Than 2 Months [closed]

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 ...
Ali Adil's user avatar
  • 113
0 votes
1 answer
488 views

Event and mysqldump

I am trying to create an event for automatic backup using this code DELIMITER $$ CREATE EVENT IF NOT EXISTS e_AutomaticBackUp1Day ON SCHEDULE AT 1 Day STARTS '2020-07-06 10:13:00' DO BEGIN mysqldump -...
Awesome's user avatar
  • 101
0 votes
2 answers
3k views

On MariaDB event scheduler doesn't run

I'm using MariaDB 10.3.22 on debian buster; I've set up a query to cleanup some expired user session from a table; this query should run every 15 minutes; the query is correct (tested and working on ...
Francesco Piraneo G.'s user avatar
0 votes
2 answers
710 views

Mysql query - Event to delete rows by its value

need help here I want a query to delete all rows in which column value is older than today. One of the columns is 'check_in' (values in timestamp format) and I want the query to identify the row that ...
Luis Sampaio's user avatar
0 votes
1 answer
1k views

Mysql max connections and event scheduler

Is there a limit to how many "instance" of a scheduled event MySQL can run? I have set this up: CREATE TABLE IF NOT EXISTS t (c1 INT UNSIGNED NOT NULL) ENGINE=INNODB; SELECT * FROM t; DELIMITER $$ ...
Xenos's user avatar
  • 195
0 votes
0 answers
538 views

MySQL event scheduler -- Event running at wrong time

I have created a event to run EVERY 1 DAY at 3:15 (am). I know that timezones affects events and actually I create a query to check the START time in mysql.event (GMT timezone) and information_schema....
Jesus Uzcanga's user avatar
2 votes
1 answer
1k views

Does MySql event will start if the previous event doesn't finish yet?

Example I have an event that will run every 5 seconds, then the first instance of the event is triggered but more than 5 seconds later the instances still not done executing. What will happen to the ...
zer09's user avatar
  • 453
0 votes
1 answer
2k views

Why is turning on Event Scheduler Maxing my CPU?

I have search the web for the last week trying to figure this out. I have exported my tables and events, re-installed the lastest MySQL and imported. I have tried checking individual procedures. My ...
DDeathlonger's user avatar
1 vote
0 answers
116 views

MYSQL Event was executed but no effect to database

How do we troubleshoot MYSQL scheduled event that did not work as expected? We got numerous events on our database. All these event that have been scheduled and executed by event scheduler. This ...
xyonme's user avatar
  • 111
0 votes
1 answer
24 views

Dropping rows based on the previous selection statmnet

I have a database with following tables: temp_1, temp_2.... and cached_tbl. Inside cached_tbl I have column table_name and in corresponding rows I store all the temp table names I mentioned above. SO ...
Sofi's user avatar
  • 3
1 vote
3 answers
2k views

Event doesn't work

I have a working command: UPDATE ads SET ad_points = ad_points - 20 And I would like to perform this action every day. After creating the event in phpMyAdmin (MYSQL) nothing happens (on the next ...
pnz1337's user avatar
  • 113
2 votes
1 answer
805 views

How to open a file in MySQL event scheduler?

I am currently creating my first event in MySQL: CREATE EVENT check_for_uploads ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 MINUTE ON COMPLETION PRESERVE DO // I would like to open a .php file ...
Tim von Känel's user avatar
-2 votes
1 answer
6k views

Automatically update data every hour

I'm trying to understand how EVENTs work. Can someone explain the concept, preferably with a demo? I think this would update data every hour; am I correct? CREATE EVENT reset ON SCHEDULE ...
Dinesh kushwaha's user avatar
3 votes
3 answers
4k views

"SHOW EVENTS" fails with "Error Code: 1545. Failed to open mysql.event"

I have a MariaDB 5.5.56 install (The default CentOS 7 package). The VM was running on a host that had some problems reaching its storage. This resulted in the OS remounting some filesystems read-only....
Gert van den Berg's user avatar
2 votes
1 answer
4k views

Restart event scheduler and alter event when slave being promoted to master

I am using innnodb cluster. It is good that every time a R/W node failed the R/O node will being promoted to R/W. However I have to restart scheduler and alter event enabled (originally slave side ...
Yen's user avatar
  • 193
1 vote
0 answers
3k views

How do you confirm a scheduled event is working?

Created an event using CREATE EVENT. It exists: +---------+-------------------------+----------------+-----------+-----------+------------+----------------+----------------+---------------------+--...
DrDamnit's user avatar
  • 205
1 vote
2 answers
3k views

Update files or a table every 5 seconds or for every update to a table whichever is the less frequent

There is a table 'votescount' which is being updated every time a user vote. I need to display three rows with maximum votes. Now the problem is If the users are less in number and less frequent ...
Anubhav's user avatar
  • 21
0 votes
1 answer
1k views

Executing delayed inserts with MySQL event scheduler

A table that I'm working on, has two triggers; one is after insert and the other is before delete. These triggers carry out calculations and copy over some rows to a backup table. This backup table is ...
Kanuj Bhatnagar's user avatar
6 votes
1 answer
9k views

View MySQL Event Body

Is there a way to view the body of a MySQL event? The SQL part after the DO section? I can easily rename, enable, disable, even alter the schedule and the body separately, but exactly viewing what my ...
Kurt Van den Branden's user avatar
0 votes
3 answers
1k views

Create a mysql event with condition [closed]

I currently have a mysql database where I keep data about rented books. When somebody rents a book, I save on the database an expiration date. So, I want to create an mysql event to update the book ...
Rosário Pereira Fernandes's user avatar
0 votes
1 answer
807 views

Event to update a column won't run

I have successfully created an event in MySQL to update a column called dob in a table called auth. My problem is that the event won't run. Here is my code: DELIMITER $$ CREATE EVENT ...
mvimal678's user avatar
0 votes
1 answer
987 views

MySQL Event Help - Update column value for each row every 15 minutes

Okay so if I have a login database: id | email | pass | attempts ---------------------------- 1 | "" | "" | 4 2 | "" | "" | 2 Attempts marks the number of attempts made at logging ...
j. Doe's user avatar
  • 1
1 vote
1 answer
4k views

MySQL 5.6 - Creating an event inside a stored procedure

I am trying to create a procedure which create an event in MySQL. For example, something similar to this: delimiter // CREATE PROCEDURE schedule_my_db_job() BEGIN CREATE EVENT MY_DB_JOB ...
Manjula's user avatar
  • 149
0 votes
1 answer
116 views

Basics of creating a table and refreshing it via a mysql event

My apologies in advance for my display of ignorance. Is there a way for the event_body of an event to take the following: DROP TABLE IF EXISTS compdist1.comp_CL1; CREATE TABLE compdist1.comp_CL1 AS ...
Chano's user avatar
  • 1
1 vote
1 answer
4k views

MySQL - Enabling Scheduled Event on Master and Slave Simultaneously

This may seem a bit strange, but I am trying to get a Scheduled Event to execute on both Master and Slave. I have two databases set up in a Master (A) to Master (B) replication environment. Master A ...
IGGt's user avatar
  • 2,156
2 votes
2 answers
25k views

Use event schedule and stored procedure to automatically average every hour MySQL

I have a database in Mysql Workbench about weather that updates every second. It contains temperature and wind speed. This is my database: CREATE TABLE `test`.`new_table` ( `id` INT(10) NOT NULL, `...
Tia's user avatar
  • 21
2 votes
2 answers
11k views

Creating Event that execute at end of each month

I need to create an event in mysql that runs at the end of every month 11 PM.I have tried creating an event that creates another events with code below: DELIMITER | CREATE EVENT `2014-10-...
Masoud's user avatar
  • 491