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
1 answer

MySQL - automatically update row after x seconds of inactivity (set expiration time)

For an art project I am trying to set up an order site. The concept allows users to book a max. of two time slots with each artist. There are 12 slots per artist, but each slot with a specific definition (so each is unique). The slots are only…
0
votes
1 answer

Drop Mysql Event as soon as it completes the task

Good day. I was trying to find any documentation but i did not find any and neither an explanation to a situation where i actually need an event to be executed and after the event is execute within the given query statement the event must be…
0
votes
0 answers

codeigniter mysql error 1054 create event

I'm running the following snippet: $name= $this->session->userdata("user")->email; $post_array["status"] = 0; //print_r($post_array); $event = "name".$primary_key; $comment = "comment"; $this->db->query("DROP EVENT IF EXISTS…
Frontrider
  • 47
  • 1
  • 10
0
votes
1 answer

Upload blob into MySQL using SQL

My intention is to upload a blob data into MySQL/MariaDB table field automatically every day. I want to use SQL scheduled events for that. But I cannot sort out the SQL query. The original file is on the web, but even for my local machine, I can't…
ZygD
  • 22,092
  • 39
  • 79
  • 102
0
votes
0 answers

Mysql Event action stopped executing automatically

I created an event which automatically gets the system current date and matches it with the start and end date of a school year. If the system current date is within the start and end date of the school year, it updates the isCurrentSchoolYear…
heisenberg
  • 1,784
  • 4
  • 33
  • 62
0
votes
0 answers

MySQL event update every friday at specific time

So i want to update my column point and make it 0 every friday at 15:00 this is my code: CREATE EVENT updatepoints ON SCHEDULE EVERY 1 WEEK STARTS CURRENT_DATE + INTERVAL 4 - WEEKDAY(CURRENT_DATE) DAY, '15:00:00' DO UPDATE people SET point = 0; I…
0
votes
0 answers

MySQL Event - Update When

I have a table with 7500+ records and every day is inserted about 300 new ones. Each new record can belong to a particular partner where each partner has its own idpartner. Example of records: (partner A -> idpartner: 1 / partner B -> idpartner: 2 /…
0
votes
1 answer

How to schedule events and create triggers with mysql

I have 3 tables in my database, tbl_events, tbl_exceptions, tbl_archived_events tbl_events stores a list of events, this contains the following fields **eventID** => int(4)Key, AutoIncrement eventREF => VARCHAR (4) ( will remain the same for each…
BBLJ84
  • 175
  • 1
  • 12
0
votes
0 answers

Syntax error when saving MySQL event with INSERT AND DELETE

I created an EVENT basically does two things: SELECT the rows that are more than 30 days old and INSERT into the achieve table. DELETE the rows that are older than 30 days old in the trends table. I separately tested the two scripts and they both…
noob
  • 480
  • 3
  • 20
0
votes
1 answer

Can I avoid two MySQL events running at the same time?

I have an event in MySQL that I want to run very frequently at least every 30 seconds. It is processing data from a queue table that contains recently updated records. Sometimes I receive large batches of updates. When this occurs the event may…
Hans
  • 2,800
  • 3
  • 28
  • 40
0
votes
1 answer

Error while creating MySql event scheduling for a specific period of time everyday with an interval of i hour

Error while creating MySql event scheduling for a specific period of time everyday with an interval of 1 hour. My code are CREATE EVENT your_event ON SCHEDULE EVERY 30 MINUTE STARTS '2013-10-01 10:00:00' DO IF time(CURRENT_TIMESTAMP)…
0
votes
2 answers

Why did this error happened when created EVENT with compound statement?

From this SO question. I got confused with DELIMITER. And I also tried something like following: CREATE EVENT test ON SCHEDULE EVERY 2 MINUTE DO BEGIN SELECT 1; SELECT 2; END This got me error like mentioned question: Error Code: 1064 You have…
Blank
  • 12,308
  • 1
  • 14
  • 32
0
votes
1 answer

How to reset a column value in MySQL after it's been set to a certain value after 1 hour?

Hi I am quite new to MySQL events and triggers, I have a table called userstatus(userid, timestamp,count, flag) which is used to store data about the user if he's blocked or not. When count reaches 4, the flag becomes 0(blocked). Can you please help…
0
votes
2 answers

MySQL / MariaDB event to optimize database tables

I'm interested in creating a recurring event to optimize my database tables every night. I got to SELECT Concat('OPTIMIZE TABLE ', TABLE_NAME, ';') FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='database_name';. How can I execute every line via…
Silithus
  • 181
  • 2
  • 13
0
votes
1 answer

Trigger 10 minutes after (MySql)

name_id(INT)(PRIMARY) name(VARCHAR(50)) add_time(DATETIME) 1 stuff 2015-10-22 10:55:41 2 stuff 2015-11-25 14:54:20 I have table main as shown. User can add new stuff into…
user5670402