title: cannot grant privileges to mysql database
body: <p>I have mysql Server version: 5.5.32-0ubuntu0.12.04.1 (Ubuntu) installed linux Ubuntu 12.04 LTS.</p>
  
  <p>I seem to have all the permissions as root. I can create a user and a db. However, I cannot seem to give the user all the permissions to the db.</p>
  
  <p>My .my.cnf:</p>
  
  <pre><code>[client]
  user=root
  password=test
  </code></pre>
  
  <p>I login through <code>mysql -u root -h localhost -p</code>, but I cannot login without the <code>-p</code> option though I have the .my.cnf (not an issue, but odd).</p>
  
  <p>There were a bunch of root users, so I got rid of them and I have these users:</p>
  
  <pre><code>mysql&gt; SELECT host,user,password FROM mysql.user;
  +-----------+------------------+-------------------------------------------+
  | host      | user             | password                                  |
  +-----------+------------------+-------------------------------------------+
  | localhost | root             | ***************************************** |
  | localhost | debian-sys-maint | ***************************************** |
  +-----------+------------------+-------------------------------------------+
  
  mysql&gt; SHOW GRANTS FOR 'root'@'localhost';
  +----------------------------------------------------------------------------------------------------------------------+
  | Grants for root@localhost                                                                                            |
  +----------------------------------------------------------------------------------------------------------------------+
  | GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*****************************************' |
  | GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION                                                         |
  +----------------------------------------------------------------------------------------------------------------------+
  </code></pre>
  
  <p>Now, I create a db, a user. The last line shows an error when I grant permissions. Can you please let me know why I am getting this error and what I can do to make this work?</p>
  
  <pre><code>mysql&gt; create database staging;
  Query OK, 1 row affected (0.00 sec)
  
  mysql&gt; CREATE USER 'staging'@'localhost' IDENTIFIED BY 'test';
  Query OK, 0 rows affected (0.00 sec)
  
  mysql&gt; GRANT ALL PRIVILEGES ON staging.* TO 'staging'@'localhost';
  ERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'staging'
  </code></pre>