1.安裝Mysql,安裝過程當中,設置用戶名"hive",密碼"hive"java
2.賦予"hive"用戶權限mysql
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%' IDENTIFIED BY 'hive'; FLUSH PRIVILEGES;
3.將jar包"mysql-connector-java-5.1.10-bin.jar"放到hive/lib文件夾下sql
4.修改"hive-site.xml"文件數據庫
<property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://192.168.10.25:3306/hive?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>
5.修改數據庫hive編碼格式。至此,配置已完成。編碼
ALTER DATABASE HIVE CHARACTER SET LATIN1;