title: mysql connection error with hive
body: <p>When i am trying to connect mysql remotely(from datanode in hadoop-2.5.1 cluster) with hive it throwing errot:</p>
  
  <blockquote>
  <pre><code>Caused by: java.sql.SQLException: Unable to open a test connection to the given database. JDBC url = jdbc:mysql://192.168.4.43:3306/metastore ? createDatabaseIfNotExist=true, username = root. Terminating connection pool. Original Exception: ------
  java.sql.SQLException: null,  message from server: "Host 'ravi' is not allowed to connect to this MySQL server"
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078)
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975)
      at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1110)
      at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2483)
      at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2516)
      at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2301)
      at com.mysql.jdbc.ConnectionImpl.&lt;init&gt;(ConnectionImpl.java:834)
      at com.mysql.jdbc.JDBC4Connection.&lt;init&gt;(JDBC4Connection.java:47)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:526)  org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:72)
      at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:2372)
      at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:2383)
      at org.apache.hadoop.hive.ql.metadata.Hive.getDatabase(Hive.java:1139)
  Caused by: java.sql.SQLException: null,  message from server: "Host 'ravi' is not allowed to connect to this MySQL server"
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078)
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975)
      at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1110)
      at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2483)sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
      at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
  14/11/17 14:06:53 INFO ql.Driver: &lt;/PERFLOG method=task.DDL.Stage-0 start=1416213412561 end=1416213413277 duration=716&gt;
  FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient
  14/11/17 14:06:53 ERROR ql.Driver: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient
  </code></pre>
  </blockquote>
  
  <p>please if anyone have solution let me know. 
  thanks in advance</p>