title: How to reset the forgotten MySQL root password?
body: <p>I have been trying to reset the root password of MySQL.</p>
  
  <p>I have used to two methods to reset. But I didnt get it.</p>
  
  <p>Following steps are done, But it doesn't work for me:</p>
  
  <p><strong>METHOD-1:</strong></p>
  
  <blockquote>
    <p>1) Stopped running of MySQL services and created a mysql-init.txt file.
    mysql-init.txt contains:</p>
  </blockquote>
  
  <pre><code>USE mysql;
  
  UPDATE mysql.user SET Password=PASSWORD('vikash') WHERE User = 'root';
  
  FLUSH PRIVILEGES;
  </code></pre>
  
  <blockquote>
    <p>2) I have opened the command prompt and i typed the following:</p>
  </blockquote>
  
  <pre><code>C:\Program Files\MySQL\MySQL Server 5.6\bin&gt;mysqld.exe --defaults-file="my.ini" --init-file="C:\\Users\\user-name\\Desktop\\mysql-init.txt" --console
  </code></pre>
  
  <p>The ERROR which i got is as follows:</p>
  
  <blockquote>
    <p>Could not open required defaults file: C:\Program Files\MySQL\MySQL Server 5.6\b
    in\my.ini</p>
  </blockquote>
  
  <p>Fatal error in defaults handling. Program aborted</p>
  
  <p><strong>METHOD-2:</strong></p>
  
  <pre><code>I simply opened the command prompt and typed as follows:
  
  C:\Program Files\MySQL\MySQL Server 5.6\bin&gt;mysqladmin -uroot -psample password
  vikash
  
  I got the error as:
  
  Warning: Using a password on the command line interface can be insecure.
  mysqladmin: connect to server at 'localhost' failed
  error: 'Access denied for user 'root'@'localhost' (using password: YES)'
  </code></pre>
  
  <p>Please help me to reset the password...</p>