Configure hive to use the MySQL database
------------------------
1. Download and pressure hive.tar.gz
2. Configure Environment variables
Hive_home= ...
Path=: $HIVE _home/bin: $HIVE _home/conf
$>source/etc/environment
3. Create a configuration file
$>CD conf
$ CP hive-default.xml.template Hive-site.xml
$ CP hive-env.sh.template hive-env.sh
$ CP hive-exec-log4j.properties.template Hive-execlog4j.properties
$ CP hive-log4j.properties.template Hive-log4j.properties
4. Modify the conf/hive-env.sh configuration file
Export Hadoop_home=/soft/hadoop
Export hive_conf_dir=/soft/hive/conf
5. Modify the Conf/hive-site.xml file
Hive.metastore.warehourse.dir=/user/hive/warehouse//hdfs System
Hive.exec.scratchdir=/tmp/hive-${user.name}//hdfs system
6. Configure the use of MySQL database
0. Create a myhive database on MySQL
Create Database myhive;
1. Configure Hive-ste.xml
[Conf/hive-site.xml]
#javax. Jdo.option.ConnectionURL//The database URL
#javax. Jdo.option.ConnectionDriverName//The JDBC driver name
#javax. Jdo.option.ConnectionUserName//Database username
#javax. Jdo.option.ConnectionPassword//Database Password
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://myhost:3306/myhive?createDatabaseIfNotExist=true</value>
<DESCRIPTION>JDBC connect string for a JDBC 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>hive</value>
<description>username to use against Metastore database</description>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>hive</value>
<description>password to use against Metastore database</description>
</property>
7. Copy the MySQL driver to ${hive_home}\lib
This article is from the "11009607" blog, please be sure to keep this source http://11019607.blog.51cto.com/11009607/1832275
MySQL Configuration note for hive