title: Access denied for user 'root@localhost' (using password:NO)
body: <p>I'm new to MySQL, I'm trying to run WordPress in my Windows desktop and it needs MySQL.</p>
  
  <p>I install everything with <code>Web Platform Installer</code> which is provided by Microsoft. I never set a root password for MySQL and in the final step of installing WordPress, it asks for a MySQL server password.</p>
  
  <p>What is the default password for root (if there is one) and how to change it?</p>
  
  <p>I tried:</p>
  
  <pre><code>mysql -u root password '123'
  </code></pre>
  
  <p>But it shows me:</p>
  
  <pre><code>Access denied for user 'root@localhost' (using password:NO)
  </code></pre>
  
  <p>After this I try:</p>
  
  <pre><code>mysql -u root -p
  </code></pre>
  
  <p>However, it asks for a password which I don't have.</p>
  
  <hr>
  
  <p><strong>Update</strong>: as Bozho suggested, I did the following:</p>
  
  <ol>
  <li>I stopped the MySQL Service from Windows services</li>
  <li>Opened CMD</li>
  <li>Changed the location to c:\program files\mysql\bin</li>
  <li><p>Executed the command below</p>
  
  <p><code>mysqld --defaults-file="C:\\program files\\mysql\\mysql server 5.1\\my.ini" --init-files=C:\\root.txt</code></p></li>
  <li><p>The command ran with a warning about character set which I mentioned below</p></li>
  <li>I start the MySQL service from Windows services</li>
  <li><p>I write in the command line</p>
  
  <p><code>mysql -u root -p</code>
  <code>EnterPassword: 123  // 123 was the password</code></p></li>
  <li><p>The command line shows the following error</p>
  
  <p><code>Access denied for user 'root@localhost' (using password:**YES**)</code></p></li>
  </ol>
  
  <p>How do I solve this? I'm waiting to hear from you.</p>