MySQL: How to create a new user and a view for him

mysql> create user 'lowprivus'@'localhost' IDENTIFIED BY 'secretpass'

grant all privileges on databaselow.* to 'lowprivus'@'localhost'



flush privileges;

create view testview as select * from databaselow.table


grant select on databaselow.testview to 'lowprivus'@'localhost'

flush privileges;


REVOKE

REVOKE ALL privileges on databaselow.* from 'lowprivus'@'localhost';

 show grants for lowprivus

REVOKE select from 'lowprivus'@'%';


links
http://serverfault.com/questions/117525/how-can-i-show-users-privileges-in-mysql

http://dev.mysql.com/doc/refman/5.0/en/revoke.html
http://stackoverflow.com/questions/3108656/grant-a-user-permission-to-only-view-a-mysql-view
http://dev.mysql.com/doc/refman/5.0/en/create-view.html