title: How to grant specific privileges to user in MySQL?
body: <p>I'd like to allow user to SELECT from specific tables and views, and EXECUTE specific procedures. I've written such a script:</p>
  
  <pre><code>CREATE USER 'user'@'%' IDENTIFIED BY 'user';
  GRANT SELECT ON 
  database.table1,
  database.view1,
  database.view2
  'user'@'%' IDENTIFIED BY 'user'
  WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
  GRANT EXECUTE ON PROCEDURE
  database.procedure1,
  database.procedure2
  'user'@'%' IDENTIFIED BY 'user'
  WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
  </code></pre>
  
  <p>But it doesn't work. What am I doing wrong?</p>