views:

35

answers:

2

Hi, I'm using MySQL 5.1.44, let's say I have a table with records inserted by different users of my application, how can I give some specific user access to only see his records on the table? I've think about creating a view with his records but don't know how to create a mysql user that only can view that view..

So, is it possible to create a mysql-user that only has access to a single view? can also this user be made so only has read-only access to the view?

Thanks!

PS: What I call users in my example are really subsidiary offices that want to access their records with their own applications..

+1  A: 

GRANT SELECT ON database1.view1 TO 'someuser'@'somehost';

Naktibalda
+1  A: 
GRANT SELECT ON <database name>.<view name>
TO <user>@<host> IDENTIFIED BY '<password>'

Source: MySQL Documentation

Anax