title: java.sql.SQLException: Failed to start database 'metastore_db' ERROR, while initializing database using hive
body: <p>I installed Hadoop and Hive on 3 cluster. I have able to login to hive from my cluster node where HIVE is running. </p>
  
  <blockquote>
    <p>root@NODE_3 hive]# hive Logging initialized using configuration in
    jar:file:/usr/lib/hive/lib/hive-common-0.10.0-cdh4.2.0.jar!/hive-log4j.properties
    Hive history
    file=/tmp/root/hive_job_log_root_201304020248_306369127.txt hive> show
    tables ; OK Time taken: 1.459 seconds hive></p>
  </blockquote>
  
  <p>But when i try to run some hive test on my cluster nodes , I am getting following given below error.</p>
  
  <p>Here it is trying to initilize data base as user =ashsshar{my username}</p>
  
  <blockquote>
    <p>3/04/02 02:32:44 INFO mapred.JobClient: Cleaning up the staging area
    hdfs://scaj-ns/user/ashsshar/.staging/job_201304020010_0080 13/04/02
    02:32:44 ERROR security.UserGroupInformation:
    PriviledgedActionException as:ashsshar (auth:SIMPLE)
    cause:java.io.IOException: javax.jdo.JDOFatalDataStoreException:
    Failed to create database '/var/lib/hive/metastore/metastore_db', see
    the next exception for details. NestedThrowables:
    java.sql.SQLException: Failed to create database
    '/var/lib/hive/metastore/metastore_db', see the next exception for
    details. java.io.IOException: javax.jdo.JDOFatalDataStoreException:
    Failed to create database '/var/lib/hive/metastore/metastore_db', see
    the next exception for details. NestedThrowables:
    java.sql.SQLException: Failed to create database
    '/var/lib/hive/metastore/metastore_db', see the next exception for
    details.</p>
  </blockquote>
  
  <p>I have tried two things . </p>
  
  <p>1 . Giving permission to cd /var/lib/hive/metastore/metastore_db </p>
  
  <ol>
  <li>Removing rm /var/lib/hive/metastore/metastore_db/*lck</li>
  </ol>
  
  <p>But still i am getting the same error </p>