19.1. Stored Routines and the Grant Tables
Stored routines require the proc
table in the
mysql
database. This table is created during
the MySQL 5.1 installation procedure. If you are
upgrading to MySQL 5.1 from an earlier version, be
sure to update your grant tables to make sure that the
proc
table exists. See
Section 5.5.2, “mysql_upgrade — Check Tables for MySQL Upgrade”.
The server manipulates the mysql.proc
table in
response to statements that create, alter, or drop stored
routines. It is not supported that the server will notice manual
manipulation of this table.
The MySQL grant system takes stored routines into account as
follows:
The CREATE ROUTINE
privilege is needed to
create stored routines.
The ALTER ROUTINE
privilege is needed to
alter or drop stored routines. This privilege is granted
automatically to the creator of a routine.
The EXECUTE
privilege is required to
execute stored routines. However, this privilege is granted
automatically to the creator of a routine. Also, the default
SQL SECURITY
characteristic for a routine
is DEFINER
, which enables users who have
access to the database with which the routine is associated to
execute the routine.