Broad Network


The Event Privilege

Event in MySQL - Part 3

Forward: In this part of the series, I explain how you can be given the privilege to create, alter and delete events.

By: Chrysanthus Date Published: 4 Sep 2012

Introduction

This is part 3 of my series, Event in MySQL. In this part of the series, I explain how you can be given the privilege to create, alter and delete events. Without such privilege, no matter how good you are in MySQL you will not be able to create, alter and delete events. I assume you have read the previous part of the series before reaching here, because this is a continuation.

Only One Privilege
You need just one privilege to be able to create, alter and drop (delete) events. That privilege is called, the Event privilege. Remember, the database administrator normally called, root in MySQL has all the privileges. He can grant you, the user (coder) of MySQL any privilege he has. If the root has given you the privilege With Grant Option, then you can also give another user the privilege. Well, in this tutorial let us assume that only the root has the Event privilege and he is willing to grant it to (share it with) you.

Privilege to You for One Database
If you are allowed to use only one database in a MySQL server, and your account name is, peter@theserver.com ,  then the root can grant you the Event privilege for the database as follows:

    GRANT EVENT ON aDB.* TO peter@theserver.com;

where aDB is the database.

If you have been reading the tutorials in this volume in the order given, then you should be familiar with the GRANT statement.

If you have been granted the Event privilege in a sector and if what is known as Event Scheduler is turned on, then you just have to go ahead and start creating, altering and dropping events, in that sector.

Privilege to You for All Server Databases
If you are allowed to use all the databases of a MySQL server, which is very unlikely, then the root can grant you the Event privilege to all databases as follows:

    GRANT EVENT ON *.* TO peter@theserver.com;

Note that here, aDB has been replaced by *.

That is it for Event Privilege in MySQL, in this series. It is one privilege that you use for three features of any event, which are to create, alter and drop the event. Simple! Event in MySQL is not as difficult to learn as it appears. I say so on the assumption that you have been reading my tutorials in this volume in the order given. There are other things to learn on Events, but I will teach those in my MySQL Database Administration course, which is part of my Webmaster course.

Just be patient; continue to read the tutorials in my blog, and we shall finally get there. Where? To job and the pleasure of coding. In my opinion, programming is one of the professions that really give job satisfaction.

We take a break here and continue in the next part of the series.

Chrys
NEXT

Comments

Become the Writer's Fan
Send the Writer a Message