- 配置
hive-site.xml
<configuration>
<property>
<name>hive.metastore.local</name>
<value>true</value>
</property>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>hive</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>hive</value>
</property>
</configuration>
- 下载
mysql-connector-java-*.*.jar
,放到lib
目录下。 - 配置
hive-env.sh
,添加
HADOOP_HOME=/opt/soft/hadoop/hadoop
export HIVE_CONF_DIR=/opt/hive/conf
- 初始化数据库
./schematool -initSchema -dbType mysql