Jump to content

granting user access


mckenzie

Recommended Posts

hello there, Iam trying to grant a newly created user, access to 3 tables called STUDENT, INSTRUCTOR and UNIVERSITY but be restricted to only those students/instructors who have links with UK universities. Any ideas? I'm new to SQL so will have a stab at it: grant select * from student, instuctor, university where country = 'uk'

Link to comment
Share on other sites

The syntax of the GRANT query, is this:

GRANT rights (columns) ON tablename TO accountname@hostname IDENTIFIED BY 'password'
So in your case it might be like this:
GRANT select ON student, instuctor, university TO accountname@hostname IDENTIFIED BY 'password'
To grant permission to only UK universities, which can't in a GRANT query, should be validated by each action the account does I think :)This query should help you for now anyway :)
Link to comment
Share on other sites

  • 3 weeks later...

The address of the university is formatted as address_type e.g. streetcitycountrywould the syntax recommended be appropriate still?The uni ID is a foreign key in both the student and lecture tables (if you need to know that)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...