3

I have created a database with several tables, such as user, booking etc.

I have allocated privileges using the User tab within phpmyAdmin, wherein, Users are permitted View and Add privileges, Administrators have View, Add and Amend privileges and Managers have ALL privileges including Delete.

Using the MySQL database, is it possible to do some restrictions as below:

a) Restrict the User to View and Add to only certain tables.

b) Allow the User to view records solely for themselves and not those of any another user.

If so How?

1 Answer 1

3

You can give privileges to some users to some tables using mysql GRANT as below

GRANT SELECT, INSERT, UPDATE ON db.booking TO 'someuser'@'somehost';

For all privileges use ALL instead of SELECT, UPDATE etc.

GRANT ALL ON db.booking TO 'someuser'@'somehost';

For documentation please go through mysql GRANT

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.