title: #1045 Cannot Log in to the MySql server from both phpMyAdmin and from command line
body: <p>The problem is I could not remember the root password I set on the XAMPP Security page and because I could not log into PHPmyAdmin and create a database I assumed I should reset the password for the root account. No changes I make in PHPMyAdmin's security page or in the command line seem to bear any positive results for me.</p>
  
  <p>Though it seems this issue has been addressed numerous times already, I've read numerous articles here and on different sites regarding this error and still I find no thread with the answer.</p>
  
  <p>What I have done is repeat a few flavors of the below, numerous times, to get going.  I still cannot get into phpMyAdmin or do anything in the command line with the root account.</p>
  
  <p>I have:</p>
  
  <ul>
  <li><p>reset my root Passwords for Windows Systems via a file
  (mysql-init.txt) containing these commands:</p>
  
  <p>UPDATE mysql.user SET Password=PASSWORD('1234') WHERE User='root';</p>
  
  <p>FLUSH PRIVILEGES;</p></li>
  <li><p>after turning off MySql, the above commands were run via the command
  line from my XAMPP shell (run as
  administrator), the syntax like so:</p>
  
  <p>msyqld --init-file:C:\My Website\Xampp\mysql\mysql-init.txt 
  Note: the file resides in the mysql folder. I placed it there.</p></li>
  <li><p>I at points I have modified my config.inc.php file, changing the
  password, but with no real different<br>
  outcome.</p>
  
  <p>$cfg['Servers'][$i]['host'] = 'localhost';<br>
  $cfg['Servers'][$i]['auth_type']     = 'cookie';<br>
  $cfg['Servers'][$i]['user'] = 'root'; 
  $cfg['Servers'][$i]['password'] = ''; \ This was changed and matched to changes made to Xampp sec
  $cfg['Servers'][$i]['extension'] = 'mysqli';
  $cfg['Servers'][$i]['AllowNoPassword'] = true;
  $cfg['Lang'] = '';</p></li>
  <li><p>if i try logging onto the PHPMyadmin webpage with the root account, I
  get "#1045 Cannot log in to the MySQL<br>
  server"</p></li>
  <li><p>if i try logging into mysql from the command line (run as
  administrator), with the command:
  mysql -u root -p 
  (password entered)....
  I get the same thing.</p></li>
  <li><p>From the command line i've run this command as well...
  mysqladmin -u root password 1234
  error: "Access denied for user 'root'@'Localhost' (using password: NO)</p></li>
  <li><p>Also did this:
  SET PASSWORD FOR root@localhost = PASSWORD('1234');
  Seemed to work, but i was still not able to sign on using the account (error 1045)</p></li>
  </ul>
  
  <p>I've heard it mentioned that there are two root accounts. Can anyone explain or point to the most succinct sources on how I am to start up using the database using these accounts?</p>
  
  <p>Also, can any tell me why I'm able to log into the webpage as any random user ID with no password, but root is </p>
  
  <p>locked out. I'm sure it's because the root account is the most powerful account. How does one get back in the door with root since it seems locked out for it's own good (protected from... me). Forgive my lack of understanding on this. I hope someone can educate me. Please if there is one stupid little thing I'm doing wrong, I'd love to hear about it.</p>
  
  <p>Thanks 
  Neil    </p>