title: Access denied while running Mysql for the first time on Centos
body: <p>I just installed Mysql for the first time on a CentOS machine using <code>yum</code>. The installation had no errors. Then I followed those steps:</p>
  
  <pre><code>$ sudo /sbin/service mysqld start --skip-grant-tables --skip-networking
  
  $ sudo /usr/bin/mysql_secure_installation
  
  NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
        SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
  
  
  In order to log into MySQL to secure it, we'll need the current
  password for the root user.  If you've just installed MySQL, and
  you haven't set the root password yet, the password will be blank,
  so you should just press enter here.
  
  Enter current password for root (enter for none): 
  ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
  Enter current password for root (enter for none): 
  ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
  Enter current password for root (enter for none): 
  ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
  Enter current password for root (enter for none): 
  ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
  Enter current password for root (enter for none): 
  </code></pre>
  
  <p>It can be seen that even after first installation there is issue in logging in to the DB. I have even tried all command in <code>sudo</code>, but the error is still there. I can't even figure out how to reconfigure MySQL. I halso have installed-removed mysql 3 times.</p>
  
  <p>How can I solve this issue?</p>