我们如何创建一个立即执行的 MySQL 一次性事件?
摘要:
示例mysql>Createtableevent_message(IDINTNOTNULLPRIMARYKEYAUTO_INCREMENT,MESSAGEVARCHAR(255)NOTNULL,Generated_atDATETIMENOTNULL);QueryOK,0rowsaffected(0.61sec)mysql>CREATEEVE...
示例
mysql> Create table event_message(ID INT NOT NULL PRIMARY KEY AUTO_INCREMENT, MESSAGE VARCHAR(255) NOT NULL, Generated_at DATETIMENOT NULL); Query OK, 0 rows affected (0.61 sec) mysql> CREATE EVENT testing_event ON SCHEDULE AT CURRENT_TIMESTAMP DO INSERT INTO event_message(message,generated_at) Values('Hello',NOW()); Query OK, 0 rows affected (0.00 sec) mysql> Select * from event_message; +----+---------+---------------------+ | ID | MESSAGE | Generated_at | +----+---------+---------------------+ | 1 | Hello | 2017-11-22 17:05:22 | +----+---------+---------------------+ 1 row in set (0.00 sec)
以上就是我们如何创建一个立即执行的 MySQL 一次性事件?的详细内容,更多请关注其它相关文章!