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

MySQLMySQLi Database

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)
raja
Published on 10-Jul-2019 12:07:24
Advertisements