Add MySQL normal user to manage hive

Source: Internet
Author: User

(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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.