为啥建立角色后,对其授予了权限,但转接给用户,无法在用户上实现权限,语句如下: create role Classmates; Query OK, 0 rows affected (0.07 sec) grant all privileges on Students to Classmates; Query OK, 0 rows affected (0.01 sec) grant select on SC to Classmates; Query OK, 0 rows affected (0.02 sec) grant Classmates to Cjh,Fxk,Rjh; Query OK, 0 rows affected (0.02 sec) 登入用户Rjh后 select * from SC; ERROR 1142 (42000): SELECT command denied to user 'Rjh'@'localhost' for table 'sc' mysql> select * from Students; +-----------+-------+------+------------+------------+----------------------+------+ | Sno | Sname | Sex | Birthday | Enrollyear | Speciality | Dno | +-----------+-------+------+------------+------------+----------------------+------+ | 202200304 | Cjk | 1 | 2004-02-28 | 2022 | Computer Techonology | CT | | 202200305 | Cwl | 0 | 2004-03-18 | 2022 | Computer Techonology | CT | | 202200306 | Cjt | 1 | 2004-02-15 | 2022 | Computer Techonology | CT | | 202201001 | Fxk | 1 | 2004-02-28 | 2022 | math | MA | | 202201002 | Swt | 0 | 2004-06-01 | 2022 | math | MA | | 202201003 | Rjh | 1 | 2004-05-22 | 2022 | math | MA | | 202201007 | Cjh | 1 | 2004-02-01 | 2022 | math | MA | 只有查询Students可以实现(因为前面用root身份进行了授权),想查询SC表却无法做到,求助具体原因,感谢 |
yejr
2024-5-17 12:25:18
| ||
万里旅人
2024-5-17 15:03:21
| ||
yejr
2024-5-17 15:57:37
| ||
万里旅人
2024-5-17 18:38:00
| ||
reddey
2024-5-17 20:33:44
| ||
一个学艺不精的国产数据库爱好者
|
||
reddey
2024-5-17 20:48:28
| ||
一个学艺不精的国产数据库爱好者
|
||
yejr
2024-5-18 07:50:19
| ||
万里旅人
2024-5-22 21:45:30
| ||
万里旅人
2024-5-22 21:51:41
| ||
合作电话:010-64087828
社区邮箱:greatsql@greatdb.com