Home > Back-end >  how to grant privileges table to user account?
how to grant privileges table to user account?

Time:10-30

so I want to grant an update to a user account like this

grant update on stuff to admin1;

but after I select * from admin1.stuff, an error "table or view does not exist". how can I see the data table in the user account

CodePudding user response:

Presume you're currently connected as user nanatua and ran

grant update on stuff to admin1;

It lets user admin1 to update values in table stuff you own. Nothing else.

If you want to let it query (select) data from that table, you have to grant it:

grant select on stuff to admin1;

Then connect as admin1 and run

select * from nanatua.stuff;

Not vice versa! as you tried to; command you used (select * from admin1.stuff) means that user admin1 owns the table, but it is not.

  • Related