MySql: Hide certain tables from certain users

允我心安 提交于 2019-12-11 07:56:30

问题


I want to hide certain tables (some definition tables) in the database from certain users. There is this mysql.tables_priv table which is empty. Should I insert something in that table to make it happen and what should be the value of 'table_priv' column?


回答1:


You should be looking into the SQL GRANT command. With GRANT, you can assign privileges to users like this:

GRANT SELECT ON table TO user;



回答2:


If the tables_priv is empty, i believe it means no privileges has been granted for that database table. You can do a quick test and grant select on database.table_name to user and see if a row appears in that table. But normally your grants on tables appear in that table.



来源:https://stackoverflow.com/questions/10295707/mysql-hide-certain-tables-from-certain-users

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!