0

I have many tables with the same table structure. I want to create a user which can access one table in all of those databases. We are adding new databases frequently, so a wildcard would be preferred. Is something like this possible?

GRANT SELECT ON *.commonTable TO 'user'@'localhost';

1

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

From the documentation it doesn't appear that you can. you can do databaseName.*, but not *.tableName.

But if you're deploying multiple databases, perhaps in your deployment process you can create a line to have that user account get created. This also allows you to set passwords per database per user.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.