title: How to GRANT privileges to user on Ubuntu MySQL database?
body: <p>I logged in as <code>root</code> with </p>
  
  <pre><code>sudo mysql -u root 
  </code></pre>
  
  <p>and created a database xxx with this command:</p>
  
  <pre><code>CREATE DATABASE xxx;
  </code></pre>
  
  <p>I want to give privileges to user webuser on xxx with this command:</p>
  
  <pre><code>GRANT ALL PRIVILEGES ON xxx.*  TO 'webuser'@'localhost';
  </code></pre>
  
  <p>I'm getting this messages:</p>
  
  <pre><code>ERROR 1133 (42000): Can't find any matching row in the user table
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <h2>Additional information:</h2>
  
  <p>The user already exists. This:</p>
  
  <blockquote>
    <p>mysql> SELECT User, Host FROM mysql.user WHERE User='webuser';</p>
  </blockquote>
  
  <p>outputs as:</p>
  
  <pre><code>+---------+------+
  | User    | Host |
  +---------+------+
  | webuser | %    |
  +---------+------+
  1 row in set (0.00 sec)
  </code></pre>