title: How can I fix the MySQL 'access denied' errors after db restore?
body: <p>I exported all databases of a MySQL server by:</p>
  
  <pre><code>    mysqldump -u root -p --all-databases &gt; /tmp/dbs.sql
  </code></pre>
  
  <p>Then I copied the file (by scp) on another server, which has the same MySQL version, and imported it with:</p>
  
  <pre><code>    mysql -u root -p &lt; dbs.sql
  </code></pre>
  
  <p>I can access to MySQL only as root. With other users, I obtain:</p>
  
  <pre><code>    ~$ mysql -u jag -p
      Enter password: 
      ERROR 1045 (28000): Access denied for user 'jag'@'localhost' (using password: YES)
  </code></pre>
  
  <p>However, selecting all users in mysql.user table, I can see that all user accounts where imported. So, how can I overcome this problem, without resetting all user passwords? </p>