Description:
-------------MYSQL 5.7----------------------------
root@MySQL-01 17:02: [test01]> select * from information_schema.events\G
...
*************************** 2. row ***************************
EVENT_CATALOG: def
EVENT_SCHEMA: test01
EVENT_NAME: test
DEFINER: root@%
TIME_ZONE: SYSTEM
EVENT_BODY: SQL
EVENT_DEFINITION: insert into test02.t1 VALUE (1)
EVENT_TYPE: RECURRING
EXECUTE_AT: NULL
INTERVAL_VALUE: 5
INTERVAL_FIELD: MINUTE
SQL_MODE: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
STARTS: 2020-05-13 14:46:05
ENDS: NULL
STATUS: ENABLED
ON_COMPLETION: NOT PRESERVE
CREATED: 2020-05-13 14:46:19
LAST_ALTERED: 2020-05-13 14:46:19
LAST_EXECUTED: 2020-05-13 15:11:05
EVENT_COMMENT:
ORIGINATOR: 3306
CHARACTER_SET_CLIENT: utf8
COLLATION_CONNECTION: utf8_general_ci
DATABASE_COLLATION: utf8_general_ci
2 rows in set (0.00 sec)
root@MySQL-01 17:23: [(none)]> select @@version;
+------------+
| @@version |
+------------+
| 5.7.17-log |
+------------+
1 row in set (0.00 sec)
-------------MYSQL 8.0----------------------------
root@MySQL-01 17:25: [(none)]> select * from information_schema.events\G
*************************** 1. row ***************************
EVENT_CATALOG: def
EVENT_SCHEMA: test01
EVENT_NAME: test
DEFINER: root@localhost
TIME_ZONE: SYSTEM
EVENT_BODY: SQL
EVENT_DEFINITION: insert into test01.t1 values (1,'Tom')
EVENT_TYPE: RECURRING
EXECUTE_AT: NULL
INTERVAL_VALUE: 5
INTERVAL_FIELD: MINUTE
SQL_MODE: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
STARTS: 2020-05-13 17:02:41
ENDS: NULL
STATUS: ENABLED
ON_COMPLETION: NOT PRESERVE
CREATED: 2020-05-13 17:02:41
LAST_ALTERED: 2020-05-13 17:02:41
LAST_EXECUTED: 2020-05-13 09:22:41
EVENT_COMMENT:
ORIGINATOR: 3306
CHARACTER_SET_CLIENT: utf8mb4
COLLATION_CONNECTION: utf8mb4_0900_ai_ci
DATABASE_COLLATION: utf8mb4_0900_ai_ci
1 row in set (0.01 sec)
root@MySQL-01 17:25: [(none)]> select @@version;
+-----------+
| @@version |
+-----------+
| 8.0.16 |
+-----------+
1 row in set (0.00 sec)
How to repeat:
-------------MYSQL 5.7----------------------------
root@MySQL-01 17:02: [test01]> select * from information_schema.events\G
...
*************************** 2. row ***************************
EVENT_CATALOG: def
EVENT_SCHEMA: test01
EVENT_NAME: test
DEFINER: root@%
TIME_ZONE: SYSTEM
EVENT_BODY: SQL
EVENT_DEFINITION: insert into test02.t1 VALUE (1)
EVENT_TYPE: RECURRING
EXECUTE_AT: NULL
INTERVAL_VALUE: 5
INTERVAL_FIELD: MINUTE
SQL_MODE: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
STARTS: 2020-05-13 14:46:05
ENDS: NULL
STATUS: ENABLED
ON_COMPLETION: NOT PRESERVE
CREATED: 2020-05-13 14:46:19
LAST_ALTERED: 2020-05-13 14:46:19
LAST_EXECUTED: 2020-05-13 15:11:05
EVENT_COMMENT:
ORIGINATOR: 3306
CHARACTER_SET_CLIENT: utf8
COLLATION_CONNECTION: utf8_general_ci
DATABASE_COLLATION: utf8_general_ci
2 rows in set (0.00 sec)
root@MySQL-01 17:23: [(none)]> select @@version;
+------------+
| @@version |
+------------+
| 5.7.17-log |
+------------+
1 row in set (0.00 sec)
-------------MYSQL 8.0----------------------------
root@MySQL-01 17:25: [(none)]> select * from information_schema.events\G
*************************** 1. row ***************************
EVENT_CATALOG: def
EVENT_SCHEMA: test01
EVENT_NAME: test
DEFINER: root@localhost
TIME_ZONE: SYSTEM
EVENT_BODY: SQL
EVENT_DEFINITION: insert into test01.t1 values (1,'Tom')
EVENT_TYPE: RECURRING
EXECUTE_AT: NULL
INTERVAL_VALUE: 5
INTERVAL_FIELD: MINUTE
SQL_MODE: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
STARTS: 2020-05-13 17:02:41
ENDS: NULL
STATUS: ENABLED
ON_COMPLETION: NOT PRESERVE
CREATED: 2020-05-13 17:02:41
LAST_ALTERED: 2020-05-13 17:02:41
LAST_EXECUTED: 2020-05-13 09:22:41
EVENT_COMMENT:
ORIGINATOR: 3306
CHARACTER_SET_CLIENT: utf8mb4
COLLATION_CONNECTION: utf8mb4_0900_ai_ci
DATABASE_COLLATION: utf8mb4_0900_ai_ci
1 row in set (0.01 sec)
root@MySQL-01 17:25: [(none)]> select @@version;
+-----------+
| @@version |
+-----------+
| 8.0.16 |
+-----------+
1 row in set (0.00 sec)
-------------create event SQL----------------------------
root@MySQL-01 16:59: [test01]> CREATE EVENT `test01`.`test`
-> ON SCHEDULE EVERY 5 MINUTE
-> ON COMPLETION NOT PRESERVE
-> ENABLE
-> DO insert into test01.t1 values (1,'Tom');
Query OK, 0 rows affected (0.04 sec)