Questions:
Is there a way, using SQL, to identify how many views are in the database per user?
How can you authorize/deny users access to delete views created by another user?
|
Questions:
| |||||
feedback
|
This question came from our site for professional and enthusiast programmers.
This will return # of views in a database.
| |||||||
feedback
|
|
Here is the definition of information_schema.views:
Here is how you can count the views per database per user
I am not that sure about access/denial of views. In the informatio_schema.views table, there is field called SECURITY_TYPE (which have values DEFINER and INVOKER). If a View has SECURITY_TYPE as INVOKER, everybody and his grandmother can SELECT from that View. My guess is that you would have to set the SECURITY_TYPE to DEFINER to restrict everyone from SELECTing from that View. Of course any user with SUPER privilege and the definer can SELECT from that View. Changing the SECURITY_TYPE is a little painful. You can mysqldump all views. Here is a post I made back on July 26, 2011 : Modify DEFINER on Many Views. @DTest had an even more concise answer using ALTER VIEW. Edit the output file in vi or some other editor to change the Give it a Try !!! | ||||
|
feedback
|