I have a database with multiple schemas. One of these schemas contains some data that needs to remain hidden from the other schemas while allowing limited access to other data. The intent is to only make the data accessible via Views and Stored Routines.
I'm using MySQL 5.7.33 on an Ubuntu server and MySQL Workbench 8.0 on Windows.
My question is, how do I set up the schema to make views, etc. accessible, but not the tables.
I've given users the following permissions on the restricted schema.
And the CREATE statement for the view begins:
CREATE
ALGORITHM = UNDEFINED
DEFINER = `DBA`@`%`
SQL SECURITY DEFINER
VIEW `CommonData`.`VW_SystemProperty` AS ...
When I run a select on the view I get the error:
Error Code: 1142. SELECT command denied to user '' for table 'VW_SystemProperty'
What am I missing?