4

As discussed here, and here, we can use wildcard when granting privileges to user.

grant all on `someSchema\_%`.* to `someUser`@`%`;

Though wildcard CANNOT be applied to table name i.e.

grant all on `someSchema\_%`.`someTable%` to `someUser`@`%`;
grant all on `someSchema\_%`.`someTable\_` to `someUser`@`%`;

My google search results non-helpful so I ask here - how can we use wildcard for BOTH schema name and table name in MySQL GRANT command?

Community
  • 1
  • 1
Nam G VU
  • 33,193
  • 69
  • 233
  • 372
  • 2
    Unfortunately, you cannot do that. Wilcards are only possible for the database name and the host (apart from the `*`-wildcard to mark all tables) – Solarflare Jan 17 '17 at 10:08
  • There is a workaround here -> https://stackoverflow.com/questions/5887104/grant-privileges-on-several-tables-with-specific-prefix – raw-bin hood Nov 29 '17 at 22:03

0 Answers0