Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add table privileges to user using mySQL Workbench

I've created a user using the server administration tools in mySQL workbench and can assign global and database permissions to those users from the administration tool.

Is there a way to assign those users (stored in mysql.users) table level privileges in mySQL Workbench?

Thanks

like image 359
Tyler DeWitt Avatar asked Jan 31 '12 20:01

Tyler DeWitt


People also ask

How do I grant creating table privileges to user in MySQL?

To GRANT ALL privileges to a user , allowing that user full control over a specific database , use the following syntax: mysql> GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';

How do I grant permission to SELECT a table in MySQL?

Select the statements for only the tables you would like to grant access to and run those queries. For example, if we only wanted to grant access to the Users and Visitors table we would run: GRANT SELECT, SHOW VIEW ON mydatabase. `Users` to 'myuser'@`myhost`; GRANT SELECT, SHOW VIEW ON mydatabase.


1 Answers

I did find a workaround. Not elegant, but it works.

  1. Open your database as an EER Model.
  2. 2 tabs will open, go to the one that is not selected by default (MySQL Model).
  3. Follow the directions here to add roles/users.
  4. Forward Engineer the model back to the database. You can deselect all objects except the users.
  5. You can either have Workbench create the users, or, if you already have the users, just set the grant statements

Not pretty, but it works

like image 62
Tyler DeWitt Avatar answered Sep 25 '22 01:09

Tyler DeWitt