FunkyShu
FunkyShu

Reputation: 138

GRANT permissions to wildcard database but specific table(s)

So, I know I can wildcard a database for all tables. For instance if I wanted to grant select to a user for all tables in matching databases, I could:

GRANT SELECT
ON 'databasesprefix%'.*
TO testuser@localhost IDENTIFIED BY 'testpasswd';

However if I wanted to grant UPDATE, DELETE, INSERT to teh user on all matching databases but only for a specific table, the following doesn't work:

GRANT UPDATE, DELETE, INSERT
ON 'databasesprefix%'.specifictable
TO testuser@localhost IDENTIFIED BY 'testpasswd';

Is there a way to doe this in SQL? or will I have to script this externally?

Upvotes: 3

Views: 1199

Answers (1)

fsw
fsw

Reputation: 3695

No. There is no way to do it in MySQL.

http://dev.mysql.com/doc/refman/5.1/en/grant.html

priv_level:
    *
  | *.*
  | db_name.*
  | db_name.tbl_name
  | tbl_name
  | db_name.routine_name

rtm :)

Upvotes: 1

Related Questions