Is there a possibility to do something like this?
GRANT SELECT , INSERT , UPDATE , DELETE ON `database`.`prefix_*` TO 'user'@'localhost';
Which allows me to set permissions quickly for every table that starts with "prefix_"
Is there a possibility to do something like this?
GRANT SELECT , INSERT , UPDATE , DELETE ON `database`.`prefix_*` TO 'user'@'localhost';
Which allows me to set permissions quickly for every table that starts with "prefix_"
You can use %
instead of *
GRANT SELECT , INSERT , UPDATE , DELETE ON `database`.`prefix\_%` TO 'user'@'localhost';
From the docs:
The
“_”
and“%”
wildcards are permitted when specifying database names in GRANT statements that grant privileges at the global or database levels. This means, for example, that if you want to use a “_” character as part of a database name, you should specify it as “_” in the GRANT statement, to prevent the user from being able to access additional databases matching the wildcard pattern;