我想在表的条件下进行授权。表中的用户名将获得授予权限。
mysql> select * from teacher;
+------------+-----------------------+---------+----------------------------+ |
teacher_id | teacher_name | dept_id | subject |
+------------+-----------------------+---------+----------------------------+
| 1 | Daw Khine Yin Mon | 1 | English |
| 2 | Daw Ei Ei Nway | 1 | English |
| 3 | Daw Thiri Kyaw | 1 | English |
| 4 | U Nay Lin Soe | 1 | English |
| 5 | Daw Zin Mar Thwal | 1 | English | 这是教师表,我以用户的身份通过...
Create user 'Daw Khine Yin Mo' identified by 'asd';
Create user 'Daw Ei Ei Nway' identified by 'asd';
Create user 'Daw Thiri Kyaw' identified by 'asd';
Create user 'U Nay Lin Soe' identified by 'asd';
Create user 'Daw Zin Mar Thw' identified by 'asd';我承认他们是...
Grant select(teacher_id,rate_no) on rating to 'Daw Khine Yin Mo','Daw Ei Ei Nway';我想创造这样的条件...
Grant select(teacher_id,rate_no) on rating to 'Daw Khine Yin Mo' where teacher.teacher_name ='Daw Khine Yin Mon';我该怎么做呢?
发布于 2016-02-29 21:03:38
创建视图,然后授予对该视图的访问权限。
CREATE VIEW
viewName
AS
SELECT(teacher_id,rate_no)
FROM RATING
WHERE teacher.teacher_name ='Daw Khine Yin Mon'
GRANT ALL ON viewName TO 'Daw Khine Yin Mo'https://stackoverflow.com/questions/35700041
复制相似问题