title: How to use GRANT with variables?
body: <p>I have some troubles with GRANT and variables together in MySql.</p>
  
  <pre><code>SET @username := 'user123', @pass := 'pass123';
  
  GRANT USAGE ON *.* TO @username@'%' IDENTIFIED BY @pass;
  GRANT INSERT (header1, header2, headern) ON `data` TO @username@'%';
  GRANT SELECT (header1, header2) ON `data2` TO @username@'%';
  </code></pre>
  
  <p>I'd like to put username and password into variables at the begining of the script and then later use them in GRANT</p>
  
  <p>So instead of this:</p>
  
  <pre><code>GRANT USAGE ON *.* TO 'user123'@'%' IDENTIFIED BY 'pass123';
  </code></pre>
  
  <p>I'd like to use something like this:</p>
  
  <pre><code>GRANT USAGE ON *.* TO @username@'%' IDENTIFIED BY pass;
  </code></pre>
  
  <p>I'd really appreciate, if someone could show me the proper statements.
  Thank you in advence!</p>