By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,301 Members | 1,752 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,301 IT Pros & Developers. It's quick & easy.

MySQL grant syntax and use of wildcards??

P: 1
MySQL 5.0.x

Hello,
I'm trying to work out but the MySQL reference guide to the grant syntax is a little off, it says...
Note
the _ and % wildcards are allowed 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; for example, GRANT ... ON `foo\_bar`.* TO ....
so i wanted to do something like

grant all on %_log.* to .......;
and also tried
grant all on %\_log.* to ......;

Neither worked now what i'm tring to do is allow a user access to any database that has anything in the name before the "_log" part, basically if in unix or linux a *_log type thing. Is this possible so i dont have to ever keep on adding or changing grants the user has to each database named <whatever>_log or is the only way to constantly have to change and use the real database name???

Thanks and regards
Mark
Sep 25 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.