How can we grant a user to access all stored procedures in MySQL?


Let us first display all users and host from the table MySQL.user −

mysql> select user,host from Mysql.user;

This will produce the following output −

+------------------+-----------+
| user             | host      | 
+------------------+-----------+
| Bob              | %         |
| Charlie          | %         |
| Robert           | %         |
| User2            | %         |
| mysql.infoschema | %         |
| mysql.session    | %         |
| mysql.sys        | %         |
| root             | %         |
| @UserName@       | localhost |
| Adam Smith       | localhost |
| Chris            | localhost |
| David            | localhost |
| James            | localhost |
| John             | localhost |
| John Doe         | localhost |
| User1            | localhost |
| am               | localhost |
| hbstudent        | localhost |
| mysql.infoschema | localhost |
| mysql.session    | localhost |
+------------------+-----------+
20 rows in set (0.00 sec)

Let us now grant a user “Robert” to access all the stored procedures in MySQL −

mysql> GRANT EXECUTE ON web.* TO 'Robert'@'%';

This will produce the following output −

Query OK, 0 rows affected (0.24 sec)

karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know

Updated on: 30-Jul-2019

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements