Grant a user permission to only view a mysql view

后端 未结 5 845
慢半拍i
慢半拍i 2020-12-09 07:56

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 acce

5条回答
  •  没有蜡笔的小新
    2020-12-09 08:49

    If you want to make the view read only which I suspect you do. Then you should create the view with the ALGORITHM = TEMPTABLE clause.

    This will make the view read only virtue of it having to create a temp table.

    Another way to achieve read only and this is depends on your data is to stick an aggregate function. For example if you have a view which is based on a table and shows all columns then you can stick a distinct onto the select.

提交回复
热议问题