如何授予用户访问 MySQL 中所有存储过程的权限?
我们首先从 MySQL.user 表显示所有用户和主机 −
mysql> select user,host from Mysql.user;
这将生成以下输出 −
+------------------+-----------+ | 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)
现在,让我们授予用户“Robert”访问 MySQL 中所有存储过程的权限 −
mysql> GRANT EXECUTE ON web.* TO 'Robert'@'%';
这将生成以下输出 −
Query OK, 0 rows affected (0.24 sec)
广告