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.

2 Answers 2


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';

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 Dec 19, 2013 at 9:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .