title: Access denied for user 'root'@'localhost' (using password: YES) (Mysql::Error)
body: <p>I tried to deploy web application on my server and I am getting this mysql database exception </p>
  
  <p><code>Access denied for user 'root'@'localhost' (using password: YES) (Mysql::Error)</code></p>
  
  <p>I tried to access the database from the command prompt using <code>mysql -u root -p</code> I am able to do all the database operations. </p>
  
  <p>what is the error </p>
  
  <pre><code>java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2928)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:771)
      at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3649)
      at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1176)
      at com.mysql.jdbc.Connection.createNewIO(Connection.java:2558)
      at com.mysql.jdbc.Connection.&lt;init&gt;(Connection.java:1485)
      at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
      at java.sql.DriverManager.getConnection(DriverManager.java:620)
      at java.sql.DriverManager.getConnection(DriverManager.java:200)
      at com.mpigeon.DbConnection.DbConn(DbConnection.java:26)
      at com.mpigeon.CheckLoginHome.doGet(CheckLoginHome.java:39)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  </code></pre>