(i), under the root User: (Mysql)
1. Under root User: Create Hive Metabase
Create database if not exists hivedb;
2. Add user user under root user: Hadoop
Note: This place host is localhost, you can customize the hostname, such as the following SPARK1, need unification!
Insert into Mysql.user (Host,user,password) VALUES ('% ', ' Hadoop ', Password (' Hadoop '));
3. Under root users, Hadoop authorizes any host to the Hivedb database for ordinary users:
Note: dentified by ' Hadoop ' means password
Grant all privileges the hivedb.* to ' hadoop ' @ '% ' of ' identified by ' Hadoop ';
(b), modify the configuration file in hive Hive-site.xml
Before modification:
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://192.168.137.5:3306/1608b?characterEncoding=UTF-8</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>root</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>root</value>
</property>
<property>
<name>hive.aux.jars.path</name>
<value>${HIVE_HOME}/auxlib</value>
</property>
</configuration>
After modification:
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://192.168.137.5:3306/hivedb?characterEncoding=UTF-8</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>hadoop</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>hadoop</value>
</property>
<property>
<name>hive.aux.jars.path</name>
<value>${HIVE_HOME}/auxlib</value>
</property>
</configuration>
(iii), start hive
Add MySQL normal user to manage hive