Hive Configuration for Mysql db - manojkumar3036/BigData-using-Hadoop GitHub Wiki

Download Hive

Configuring hive-site.xml

`

     <property>
           <name>javax.jdo.option.ConnectionURL</name>
            <value>jdbc:mysql://localhost/metastore?createDatabaseIfNotExist=true</value>
     </property>

    <property>
            <name>hive.metastore.warehouse.dir</name>
            <value>/user/hive/warehouse</value>
            <description>location of default database for the warehouse</description>
    </property>
    <property>
            <name>hive.metastore.uris</name>
            <value/>
    </property>
    <property>
            <name>hive.metastore.schema.verification</name>
            <value>true</value>
            <description>Thrift URI for the remote metastore. Used by metastore client to connect to remote metastore.</description>
    </property>
    <property>
            <name>javax.jdo.option.ConnectionDriverName</name>
            <value>com.mysql.jdbc.Driver</value>
            <description>Driver class name for a JDBC metastore</description>
    </property>
    <property>
            <name>javax.jdo.option.ConnectionUserName</name>
            <value>root</value>
            <description>class implementing the jdo persistence</description>
    </property>
    <property>
            <name>datanucleus.autoCreateSchema</name>
            <value>true</value>
    </property>
    <property>
             <name>datanucleus.fixedDatastore</name>
            <value>true</value>
    </property>
    <property>
             <name>datanucleus.autoCreateTables</name>
             <value>true</value>
     </property>
    <property>
            <name>javax.jdo.option.ConnectionPassword</name>
            <value>root</value>
            <description>class implementing the jdo persistence</description>
    </property>

`

Configuring hive-env.sh

mv hive-env.sh.template hive-env.sh
export HADOOP_HEAPSIZE=1024
export HADOOP_HOME=path to hadoop
export HIVE_CONF_DIR=path to hive conf directory

mv hive-default.template hive-default.xml

Metastore schema verification

schematool -dbType mysql -info if gets completed successfully then the configuration of db is correct

⚠️ **GitHub.com Fallback** ⚠️