title: Error: Client does not support authentication protocol requested by server; consider upgrading MySQL client
body: <p>While executing a JDBC program, I get the following error while connecting to database:</p>
  
  <pre><code>Exception in thread "main" 
  com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Client does 
  not support authentication protocol requested by server; consider upgrading 
  MySQL client
  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:921)
  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:885)
  at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3421)
  at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1247)
  at com.mysql.jdbc.Connection.createNewIO(Connection.java:2775)
  at com.mysql.jdbc.Connection.&lt;init&gt;(Connection.java:1555)
  at 
  com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
  at java.sql.DriverManager.getConnection(DriverManager.java:664)
  at java.sql.DriverManager.getConnection(DriverManager.java:270)
  at main.java.MyFirstJdbcProgram.readDataBase(MyFirstJdbcProgram.java:23)
  at main.java.Main.main(Main.java:6)
  </code></pre>
  
  <p>When I researched this, I got to know that the below error is because I need to grant the privileges to the user, so follow</p>
  
  <ol>
  <li><code>mysql -u root -p</code>   </li>
  <li>then entered the password    </li>
  <li><p>then I ran   </p>
  
  <pre><code>GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'mypassword';    
  </code></pre>
  
  <p>and also I used    </p>
  
  <pre><code>UPDATE user SET authentication_string=password('mypassword') WHERE user='root';
  </code></pre></li>
  </ol>
  
  <p>But I'm getting below error </p>
  
  <blockquote>
    <p>ERROR 1064 (42000): You have an error in your SQL syntax; check the
    manual that corresponds to your MySQL server version for the right
    syntax to use near 'IDENTIFIED BY 'mypassword'' at line 1</p>
  </blockquote>