Skip to main content
added 1 character in body; edited tags
Source Link
RolandoMySQLDBA
  • 184.3k
  • 33
  • 323
  • 531

i am running mysql 5.1.41 that came bundled with xampp on windows. the problem is that the event doesnt run automatically even when the event scheduler is ON. i have a table named ta_table using innodb engine and it has 4 fields one of which is ti_time with a timestamp type with default value of current timestamp. this field ti_time is given the value of timestamp at which the row is inserted. now i want to delete all rows which are 2 hours old from the table ta_table so i created an event the event looks like this

CREATE EVENT ev ON SCHEDULE EVERY 1 MINUTE STARTS 2011-07-17 14:54:52 ENABLE 
    DO
    begin
    delete from ta_table where timestampdiff(minute,ti_time,now())>120;
    end

now this event should delete any rows with ti_time field greater than 2 hours(120 minutes). when i execute this query

delete from ta_table where timestampdiff(minute,ti_time,now())>120;

it works. it deletes the rows older than 2 hours. which means my query is correct but the event is not running. my event scheduler is running which i confirmed by show processlist and it shows 2 preocesses root and event scheduler. the state of the event scheduler is waiting for next activation. when i ran this query

SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev'

it gives result as

status = enabled
last executed=2011-07-18 02:36:38

but when i see the table ta_table the records are not deleted? whats wrong with this?

Edit:

As of RolandoMySQLDBA's suggestion i upgraded mysql 5.1.414 to mysql 5.5 but the event still fails

i am running mysql 5.1.41 that came bundled with xampp on windows. the problem is that the event doesnt run automatically even when the event scheduler is ON. i have a table named ta_table using innodb engine and it has 4 fields one of which is ti_time with a timestamp type with default value of current timestamp. this field ti_time is given the value of timestamp at which the row is inserted. now i want to delete all rows which are 2 hours old from the table ta_table so i created an event the event looks like this

CREATE EVENT ev ON SCHEDULE EVERY 1 MINUTE STARTS 2011-07-17 14:54:52 ENABLE 
    DO
    begin
    delete from ta_table where timestampdiff(minute,ti_time,now())>120;
    end

now this event should delete any rows with ti_time field greater than 2 hours(120 minutes). when i execute this query

delete from ta_table where timestampdiff(minute,ti_time,now())>120;

it works. it deletes the rows older than 2 hours. which means my query is correct but the event is not running. my event scheduler is running which i confirmed by show processlist and it shows 2 preocesses root and event scheduler. the state of the event scheduler is waiting for next activation. when i ran this query

SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev'

it gives result as

status = enabled
last executed=2011-07-18 02:36:38

but when i see the table ta_table the records are not deleted? whats wrong with this?

Edit:

As of RolandoMySQLDBA's suggestion i upgraded mysql 5.1.4 to mysql 5.5 but the event still fails

i am running mysql 5.1.41 that came bundled with xampp on windows. the problem is that the event doesnt run automatically even when the event scheduler is ON. i have a table named ta_table using innodb engine and it has 4 fields one of which is ti_time with a timestamp type with default value of current timestamp. this field ti_time is given the value of timestamp at which the row is inserted. now i want to delete all rows which are 2 hours old from the table ta_table so i created an event the event looks like this

CREATE EVENT ev ON SCHEDULE EVERY 1 MINUTE STARTS 2011-07-17 14:54:52 ENABLE 
    DO
    begin
    delete from ta_table where timestampdiff(minute,ti_time,now())>120;
    end

now this event should delete any rows with ti_time field greater than 2 hours(120 minutes). when i execute this query

delete from ta_table where timestampdiff(minute,ti_time,now())>120;

it works. it deletes the rows older than 2 hours. which means my query is correct but the event is not running. my event scheduler is running which i confirmed by show processlist and it shows 2 preocesses root and event scheduler. the state of the event scheduler is waiting for next activation. when i ran this query

SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev'

it gives result as

status = enabled
last executed=2011-07-18 02:36:38

but when i see the table ta_table the records are not deleted? whats wrong with this?

Edit:

As of RolandoMySQLDBA's suggestion i upgraded mysql 5.1.14 to mysql 5.5 but the event still fails

added 5 characters in body; edited title
Source Link
RolandoMySQLDBA
  • 184.3k
  • 33
  • 323
  • 531

mysql event MySQL Event does not run

i am running mysql 5.1.41 that came bundled with xampp on windows. the problem is that the event doesnt run automatically even when the event scheduler is ON. i have a table named ta_table using innodb engine and it has 4 fields one of which is ti_time with a timestamp type with default value of current timestamp. this field ti_time is given the value of timestamp at which the row is inserted. now i want to delete all rows which are 2 hours old from the table ta_table so i created an event the event looks like this

CREATE EVENT ev ON SCHEDULE EVERY 1 MINUTE STARTS 2011-07-17 14:54:52 ENABLE 
    DO
    begin
    delete from ta_table where timestampdiff(minute,ti_time,now())>120;
    end

now this event should delete any rows with ti_time field greater than 2 hours(120 minutes). when i execute this query

delete from ta_table where timestampdiff(minute,ti_time,now())>120;

it works. it deletes the rows older than 2 hours. which means my query is correct but the event is not running. my event scheduler is running which i confirmed by show processlist and it shows 2 preocesses root and event scheduler. the state of the event scheduler is waiting for next activation. when i ran this query

SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev'

it gives result as

status = enabled
last executed=2011-07-18 02:36:38

but when i see the table ta_table the records are not deleted? whats wrong with this?

Edit:

asAs of RolandoDBA'sRolandoMySQLDBA's suggestion i upgraded mysql 5.1.4 to mysql 5.5 but the event still fails

mysql event does not run

i am running mysql 5.1.41 that came bundled with xampp on windows. the problem is that the event doesnt run automatically even when the event scheduler is ON. i have a table named ta_table using innodb engine and it has 4 fields one of which is ti_time with a timestamp type with default value of current timestamp. this field ti_time is given the value of timestamp at which the row is inserted. now i want to delete all rows which are 2 hours old from the table ta_table so i created an event the event looks like this

CREATE EVENT ev ON SCHEDULE EVERY 1 MINUTE STARTS 2011-07-17 14:54:52 ENABLE 
    DO
    begin
    delete from ta_table where timestampdiff(minute,ti_time,now())>120;
    end

now this event should delete any rows with ti_time field greater than 2 hours(120 minutes). when i execute this query

delete from ta_table where timestampdiff(minute,ti_time,now())>120;

it works. it deletes the rows older than 2 hours. which means my query is correct but the event is not running. my event scheduler is running which i confirmed by show processlist and it shows 2 preocesses root and event scheduler. the state of the event scheduler is waiting for next activation. when i ran this query

SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev'

it gives result as

status = enabled
last executed=2011-07-18 02:36:38

but when i see the table ta_table the records are not deleted? whats wrong with this?

Edit:

as of RolandoDBA's suggestion i upgraded mysql 5.1.4 to mysql 5.5 but the event still fails

MySQL Event does not run

i am running mysql 5.1.41 that came bundled with xampp on windows. the problem is that the event doesnt run automatically even when the event scheduler is ON. i have a table named ta_table using innodb engine and it has 4 fields one of which is ti_time with a timestamp type with default value of current timestamp. this field ti_time is given the value of timestamp at which the row is inserted. now i want to delete all rows which are 2 hours old from the table ta_table so i created an event the event looks like this

CREATE EVENT ev ON SCHEDULE EVERY 1 MINUTE STARTS 2011-07-17 14:54:52 ENABLE 
    DO
    begin
    delete from ta_table where timestampdiff(minute,ti_time,now())>120;
    end

now this event should delete any rows with ti_time field greater than 2 hours(120 minutes). when i execute this query

delete from ta_table where timestampdiff(minute,ti_time,now())>120;

it works. it deletes the rows older than 2 hours. which means my query is correct but the event is not running. my event scheduler is running which i confirmed by show processlist and it shows 2 preocesses root and event scheduler. the state of the event scheduler is waiting for next activation. when i ran this query

SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev'

it gives result as

status = enabled
last executed=2011-07-18 02:36:38

but when i see the table ta_table the records are not deleted? whats wrong with this?

Edit:

As of RolandoMySQLDBA's suggestion i upgraded mysql 5.1.4 to mysql 5.5 but the event still fails

added 5 characters in body
Source Link
lovesh
  • 185
  • 1
  • 1
  • 6

i am running mysql 5.1.41 that came bundled with xampp on windows. the problem is that the event doesnt run automatically even when the event scheduler is ON. i have a table named ta_table using innodb engine and it has 4 fields one of which is ti_time with a timestamp type with default value of current timestamp. this field ti_time is given the value of timestamp at which the row is inserted. now i want to delete all rows which are 2 hours old from the table ta_table so i created an event the event looks like this

CREATE EVENT ev ON SCHEDULE EVERY 1 MINUTE STARTS 2011-07-17 14:54:52 ENABLE 
    DO
    begin
    delete from ta_table where timestampdiff(minute,ti_time,now())>120;
    end

now this event should delete any rows with ti_time field greater than 2 hours(120 minutes). when i execute this query

delete from ta_table where timestampdiff(minute,ti_time,now())>120;

it works. it deletes the rows older than 2 hours. which means my query is correct but the event is not running. my event scheduler is running which i confirmed by show processlist and it shows 2 preocesses root and event scheduler. the state of the event scheduler is waiting for next activation. when i ran this query

SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev'

it gives result as

status = enabled
last executed=2011-07-18 02:36:38

but when i see the table ta_table the records are not deleted? whats wrong with this?


 

Edit:

as of RolandoDBA's suggestion i upgraded mysql 5.1.4 to mysql 5.5 but the event still fails

i am running mysql 5.1.41 that came bundled with xampp on windows. the problem is that the event doesnt run automatically even when the event scheduler is ON. i have a table named ta_table using innodb engine and it has 4 fields one of which is ti_time with a timestamp type with default value of current timestamp. this field ti_time is given the value of timestamp at which the row is inserted. now i want to delete all rows which are 2 hours old from the table ta_table so i created an event the event looks like this

CREATE EVENT ev ON SCHEDULE EVERY 1 MINUTE STARTS 2011-07-17 14:54:52 ENABLE 
    DO
    begin
    delete from ta_table where timestampdiff(minute,ti_time,now())>120;
    end

now this event should delete any rows with ti_time field greater than 2 hours(120 minutes). when i execute this query

delete from ta_table where timestampdiff(minute,ti_time,now())>120;

it works. it deletes the rows older than 2 hours. which means my query is correct but the event is not running. my event scheduler is running which i confirmed by show processlist and it shows 2 preocesses root and event scheduler. the state of the event scheduler is waiting for next activation. when i ran this query

SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev'

it gives result as

status = enabled
last executed=2011-07-18 02:36:38

but when i see the table ta_table the records are not deleted? whats wrong with this?


 

as of RolandoDBA's suggestion i upgraded mysql 5.1.4 to mysql 5.5 but the event still fails

i am running mysql 5.1.41 that came bundled with xampp on windows. the problem is that the event doesnt run automatically even when the event scheduler is ON. i have a table named ta_table using innodb engine and it has 4 fields one of which is ti_time with a timestamp type with default value of current timestamp. this field ti_time is given the value of timestamp at which the row is inserted. now i want to delete all rows which are 2 hours old from the table ta_table so i created an event the event looks like this

CREATE EVENT ev ON SCHEDULE EVERY 1 MINUTE STARTS 2011-07-17 14:54:52 ENABLE 
    DO
    begin
    delete from ta_table where timestampdiff(minute,ti_time,now())>120;
    end

now this event should delete any rows with ti_time field greater than 2 hours(120 minutes). when i execute this query

delete from ta_table where timestampdiff(minute,ti_time,now())>120;

it works. it deletes the rows older than 2 hours. which means my query is correct but the event is not running. my event scheduler is running which i confirmed by show processlist and it shows 2 preocesses root and event scheduler. the state of the event scheduler is waiting for next activation. when i ran this query

SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev'

it gives result as

status = enabled
last executed=2011-07-18 02:36:38

but when i see the table ta_table the records are not deleted? whats wrong with this?

Edit:

as of RolandoDBA's suggestion i upgraded mysql 5.1.4 to mysql 5.5 but the event still fails

added 109 characters in body
Source Link
lovesh
  • 185
  • 1
  • 1
  • 6
Loading
added 22 characters in body
Source Link
lovesh
  • 185
  • 1
  • 1
  • 6
Loading
Tweeted twitter.com/#!/StackDBAs/status/92740167458238464
added 3 characters in body
Source Link
lovesh
  • 185
  • 1
  • 1
  • 6
Loading
Source Link
lovesh
  • 185
  • 1
  • 1
  • 6
Loading