title: How to resolve ERROR 1396 (HY000): Operation ALTER USER failed for 'root'@'localhost'?
body: <p>I can't login with root ,I think root's password may be changed.But I can't change root's password either.</p>
  
  <p>Mysql version is v8.0.16. </p>
  
  <p>I have used <code>--init-file</code> to specificd alter sql at mysqld booting</p>
  
  <pre><code>alter user 'root'@'localhost' identified by 'mynewpassword'
  </code></pre>
  
  <p>but it doesn't work.</p>
  
  <p>I used <code>--skip-grant-tables --user=mysql</code> so I could add a new user, and my new user works. I try to alter root,but it failed again.</p>
  
  <pre class="lang-sql prettyprint-override"><code>mysql&gt; alter user 'root'@'localhost' identified by 'mynewpassword';
  ERROR 1396 (HY000): Operation ALTER USER failed for 'root'@'localhost'
  
  </code></pre>
  
  <p>here is the table user's content</p>
  
  <pre class="lang-sql prettyprint-override"><code>mysql&gt; select user,host from user;
  +------------------+-----------+
  | user             | host      |
  +------------------+-----------+
  | admin            | %         |
  | mysql.infoschema | localhost |
  | mysql.session    | localhost |
  | mysql.sys        | localhost |
  | root             | localhost |
  +------------------+-----------+
  </code></pre>
  
  <p>Do anyone have any idea?</p>