title: MySQL Error 1045, "Access denied for user 'user'@'localhost' (using password: YES)"
body: <p>This question seem to be asked a lot however I cannot find a definitive answer.</p>
  
  <p>I am making some webapp tests using MySQL, and at the beginning I used the <em>'root'</em> user (with a non-empty password).  My root user is working fine from the apps (tested from PHP and Python's Django), from the command line, and with PHPMyAdmin.</p>
  
  <p>However I don't wanted to use the the root user, so I created another user, and I granted all privileges to the databases that user should need. (I used PHPMyAdmin logged as <em>'root'</em> for this task).</p>
  
  <p>The new user cannot log in to MySQL.  Neither from the Django app, nor PHPMyAdmin, nor the command line.</p>
  
  <p>I have two possible suspicions:</p>
  
  <ol>
  <li><p>there is a global privilege the user lacks. (As I said, I granted all database privileges, however I have not granted any global privileges);</p></li>
  <li><p>the user's configured host. (<em>'root'</em> has four lines in the <em>mysql.user</em> table, for hosts <em>'localhost'</em>, <em>'my-pc-name'</em>, <em>'127.0.0.1'</em> and <em>'::1'</em>; while the new user has one line for host <em>'%'</em>)</p></li>
  </ol>
  
  <p>(I have double-checked the password, so I am confident this is not a password problem.)</p>