Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MYSQL View existing event script

Tags:

mysql

events

MySQL Events

I have a server with existing events. I know how to list them, but I don't know what they do. is there a way to see the event script of existing events? Either in cli or in the Workbench.

like image 759
Lambda Avatar asked May 18 '17 12:05

Lambda


People also ask

How do I see the create event statement in MySQL?

Use MySQL's show create event statement to see the create event statement including its body containing the event code.

How do I change an existing MySQL event?

To change existing events, you use the ALTER EVENT statement as follows: Notice that the ALTER EVENT statement is only applied to an existing event. If you try to modify a nonexistent event, MySQL will issue an error message therefore, you should always use the SHOW EVENTS statement to check the event for its existence before changing it.

How to check the status of an event in MySQL?

You can check the status of the event by using the SHOW EVENTS statement as follows: To enable a disabled event, you use the ENABLE keyword after the ALTER EVENT statement as follows: MySQL does not provide you with the RENAME EVENT statement. Fortunately, you can use the ALTER EVENT to rename an existing event as follows:

What are MySQL events?

MySQL Events are tasks that execute according to a specified schedule. Therefore, sometimes MySQL events are referred to as scheduled events. MySQL Events are named object which contains one or more SQL statement. They are stored in the database and executed at one or more intervals.


1 Answers

Use MySQL's show create event statement to see the create event statement including its body containing the event code.

like image 119
Shadow Avatar answered Sep 19 '22 20:09

Shadow