title: Hive connectivity to MySQL: Access denied for user 'hive'@'localhost' hive
body: <p>I am setting up Hive on CentOS, and I have installed hadoop, hive and MySQL on the same server. I have also setup metastore DB on mySQL and user ID - hive has access to the database.</p>
  
  <p>I have the below issue - Error Message is given below. Can some one help to fix this issue?</p>
  
  <blockquote>
    <p>show databases;
        FAILED: Error in metadata: MetaException(message:Got exception:    org.apache.hadoop.hive.metastore.api.MetaException
    javax.jdo.JDODataStoreException: Access denied for user
    'hive'@'localhost' (using password: YES)
        NestedThrowables:
        java.sql.SQLException: Access denied for user 'hive'@'localhost' (using password: YES))
        FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask</p>
  </blockquote>
  
  <p>Hive-site.xml is given below.</p>
  
  <pre><code>   &lt;property&gt;
        &lt;name&gt;javax.jdo.option.ConnectionURL&lt;/name&gt;
        &lt;value&gt;jdbc:mysql://127.0.0.1/metastore?createDatabaseIfNotExist=true&lt;/value&gt;
      &lt;/property&gt;
  
      &lt;property&gt;
        &lt;name&gt;javax.jdo.option.ConnectionDriverName&lt;/name&gt;
        &lt;value&gt;com.mysql.jdbc.Driver&lt;/value&gt;
        &lt;description&gt;Driver class name for a JDBC metastore&lt;/description&gt;
      &lt;/property&gt;
  
      &lt;property&gt;
       &lt;name&gt;javax.jdo.option.ConnectionUserName&lt;/name&gt;
       &lt;value&gt;hive&lt;/value&gt;
       &lt;/property&gt;
  
       &lt;property&gt;
        &lt;name&gt;javax.jdo.option.ConnectionPassword&lt;/name&gt;
       &lt;value&gt;password&lt;/value&gt;
       &lt;/property&gt;
  
       &lt;property&gt;
        &lt;name&gt;hive.hwi.war.file&lt;/name&gt;
        &lt;value&gt;/usr/lib/hive/lib/hive-hwi-0.10.0-cdh4.2.0.jar&lt;/value&gt;
        &lt;description&gt;This is the WAR file with the jsp content for Hive Web Interface     &lt;/description&gt;
       &lt;/property&gt;
  
       &lt;property&gt;
        &lt;name&gt;datanucleus.fixedDatastore&lt;/name&gt;
        &lt;value&gt;true&lt;/value&gt;
        &lt;/property&gt;
  
        &lt;property&gt;
         &lt;name&gt;datanucleus.autoCreateTables&lt;/name&gt;
         &lt;value&gt;true&lt;/value&gt;
        &lt;/property&gt;
  
        &lt;property&gt;
        &lt;name&gt;hive.metastore.uris&lt;/name&gt;
          &lt;value&gt;thrift://127.0.0.1:9083&lt;/value&gt;
          &lt;description&gt;IP address &lt;/description&gt;
        &lt;/property&gt;
  
         &lt;property&gt;
         &lt;name&gt;hive.metastore.warehouse.dir&lt;/name&gt;
          &lt;value&gt;/user/hive2/warehouse&lt;/value&gt;
           &lt;description&gt; warehouse &lt;/description&gt;
          &lt;/property&gt;
  </code></pre>
  
  <p>I am able to login to MySQL using hive and password and able to create tables in Metastore Database. Not sure where is the issue? Any suggestions?</p>