2

My site has a search form, which queries a few tables for whatever my end users want to find.

What permissions should I give my MySQL user in order to search the database and update the 'times searched for' column if needed?

Feel free to ask for more information or let me know if this is a duplicate. I did spend a good five minutes searching for it.

1

You would need both SELECT and UPDATE privileges. You can choose to apply them on explicit tables. While this is the most secure way, it is also a nightmare to maintain.

Usually a reasonable compromise is to grant such privileges on the schema where your tables/views reside, and let it apply on all tables/views in that schema. I would look like this:

GRANT SELECT,UPDATE ON my_schema.* TO 'my_user'@'my_host' IDENTIFIED BY 'my_password';
1

Give read permissions to the tables and columns necessary to perform the search and nothing more.

  • That would mean a GRANT SELECT on the specific tables / views where the data resides – David Brossard Dec 19 '13 at 9:10

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.