我有一个MySQL数据库。我正在运行两个MySQL EVENT。我需要摆脱一个。我不记得它的名字。我该怎么办?
答案 0 :(得分:23)
简单的SHOW EVENTS
列出了当前架构中的所有事件
要查看特定架构的事件,请使用FROM子句。例如,要查看测试模式的事件,请使用以下语句:
SHOW EVENTS FROM test;
答案 1 :(得分:14)
information_schema.EVENTS
表是从哪里开始的。
USE information_schema;
DESCRIBE EVENTS;
+----------------------+---------------+------+-----+---------------------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+---------------+------+-----+---------------------+-------+
| EVENT_CATALOG | varchar(64) | YES | | NULL | |
| EVENT_SCHEMA | varchar(64) | NO | | | |
| EVENT_NAME | varchar(64) | NO | | | |
| DEFINER | varchar(77) | NO | | | |
| TIME_ZONE | varchar(64) | NO | | | |
| EVENT_BODY | varchar(8) | NO | | | |
| EVENT_DEFINITION | longtext | NO | | NULL | |
| EVENT_TYPE | varchar(9) | NO | | | |
| EXECUTE_AT | datetime | YES | | NULL | |
| INTERVAL_VALUE | varchar(256) | YES | | NULL | |
| INTERVAL_FIELD | varchar(18) | YES | | NULL | |
| SQL_MODE | varchar(8192) | NO | | | |
| STARTS | datetime | YES | | NULL | |
| ENDS | datetime | YES | | NULL | |
| STATUS | varchar(18) | NO | | | |
| ON_COMPLETION | varchar(12) | NO | | | |
| CREATED | datetime | NO | | 0000-00-00 00:00:00 | |
| LAST_ALTERED | datetime | NO | | 0000-00-00 00:00:00 | |
| LAST_EXECUTED | datetime | YES | | NULL | |
| EVENT_COMMENT | varchar(64) | NO | | | |
| ORIGINATOR | bigint(10) | NO | | 0 | |
| CHARACTER_SET_CLIENT | varchar(32) | NO | | | |
| COLLATION_CONNECTION | varchar(32) | NO | | | |
| DATABASE_COLLATION | varchar(32) | NO | | | |
+----------------------+---------------+------+-----+---------------------+-------+
SELECT EVENT_NAME FROM EVENTS WHERE EVENT_SCHEMA = 'your_database_name';
答案 2 :(得分:4)
SHOW EVENTS\G
这将为您提供所有现有活动的列表。对于显示事件语法:http://dev.mysql.com/doc/refman/5.1/en/show-events.html
答案 3 :(得分:1)
show events;
将显示所有事件。
答案 4 :(得分:0)
SELECT * FROM information_schema.EVENTS