6

Is phpMyAdmin capable of granting rights (permissions) on certain tables to users or roles?

When I look at the page of a database table there is no "rights" tab.

I have only found a place where I can give rights to single users.

What I need is granting some rights to several users at the same time like

grant insert, update, delete on customers to john, max, annie;

3 Answers 3

8

You can do that. Follow the pictures: In the "Privileges" tab which list your users click the "Edit Privileges" of the user.

Then select the database:

After that specific the privileges by checking them and then select your table as shown in the picture:

After you select your table, you can define the operations in detailed:

3
  • Yes, this gives rights to a single user, but not to several users as mentioned in my question. I don't want to do this over and over again for every single user I want to give rights to. It would be ok if MySQL understood the concept of roles, then I could give a role to a bunch of users and then grant the rights to that role. Unfortunately, MySQL lacks this important feature. So I will to it rather using the command line. Jan 7, 2014 at 10:30
  • 1
    Depending on your host, this might not be an option in your phpMyAdmin interface either.
    – artomason
    Mar 28, 2019 at 21:20
  • I don't see an option for table.
    – khatchad
    Feb 14, 2021 at 0:12
1

phpMyAdmin can't do such a granular rights setup, but you can do this with pure SQL. See this reference for details. It's basically just writing "GRANT" statements yourself which you can pass to phpMyAdmin.

The GRANT syntax allows you to specify multiple users in a single query.:

GRANT SELECT,INSERT,UPDATE,DELETE ON customers.* TO 'john', 'annie', 'max';
1
  • That's exactly what I already mentioned in my question, so I have been aware of that. Thanks anyway. Jan 7, 2014 at 10:28
0

With PHP my admin, anything you do shows you the query that it ran to do it at the top of the page. Copy these querys. Switch out the username and and host and rerun them.

Not GUI but if doing several users then you just do it through the GUI once and a quick copy paste for each user.

follow @shgnInc answer for the GUI part.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.