title: How to grant MySQL privileges in a bash script?
body: <p>I need to grant privileges to a database from within a bash script. Some parameters are in the form of variables, say, the username and the password. The command in a mysql shell would look like this:</p>
  
  <pre><code>GRANT ALL ON *.* TO "$user"@localhost IDENTIFIED BY "$password";
  </code></pre>
  
  <p>...Except that <code>$user</code> and <code>$password</code> would be replaced by their values.</p>
  
  <p>Is there a way to perform such a command from within a bash script?</p>
  
  <p>Thank you!</p>