The below question pertains to MySQL 5.1.44
Let's say I have a table with records inserted by different users of my application. How can I give a specific user access to only see his/her records in that table? I've thought about creating a VIEW with his/her records, but I don't know how to create a mysql user that can only see that VIEW.
So, is it possible to create a mysql-user that only has access to a single VIEW? can this user also be made so they read-only access to that VIEW?
Thanks!
PS: What I call users in my example are really subsidiary offices that want to access their records with their own applications.
解决方案
GRANT SELECT ON database1.view1 TO 'someuser'@'somehost';