Overview
The mysql.procs_priv view is used to store privilege information for stored procedures and functions.
Columns
Field |
Type |
Nullable |
Description |
|---|---|---|---|
| Host | varchar(60) | NO | Host name |
| Db | varchar(64) | NO | Database Name |
| User | varchar(32) | NO | Username (grantee) |
| Routine_name | varchar(64) | NO | Routine Name |
| Routine_type | varchar(9) | NO | Routine type |
| Grantor | varchar(93) | YES | Grantor |
| Proc_priv | varchar(27) | NO | Granted Privilege |
| Timestamp | date | YES | Grant Time |
Sample query
Query the privilege information of stored procedure functions in the current tenant.
obclient [mysql]> SELECT * FROM mysql.procs_priv LIMIT 1;
The query result is as follows:
+------+---------+------+-------------------+--------------+---------+-----------------------+------------+
| Host | Db | User | Routine_name | Routine_type | Grantor | Proc_priv | Timestamp |
+------+---------+------+-------------------+--------------+---------+-----------------------+------------+
| % | test_db | root | pro_generate_data | PROCEDURE | root@% | Execute,Alter Routine | 2023-12-21 |
+------+---------+------+-------------------+--------------+---------+-----------------------+------------+
1 row in set
References
Specifies whether to automatically grant the ALTER and EXECUTE privileges in the stored procedure: automatic_sp_privileges