title: Permission granted mysql user cannot access the particular database Caused by: java.sql.SQLException: Access denied for user
body: <p>I used</p>
  
  <pre><code>grant all on mydb.* TO user1@"localhost" identified by "user1"
  </code></pre>
  
  <p>And getting following error when access the mysql from a separate physical box.</p>
  
  <p>This is a mysql cluster(Mysql server version 5.1.56). And connector jar is mysql-connector-java-5.1.26.jar.</p>
  
  <p>Any ideas? </p>
  
  <blockquote>
    <p>Caused by: java.sql.SQLException: Access denied for user 'user1'@'166.31.44.23' (using password: YES)
            at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078)
            ...</p>
  </blockquote>