Add in Hive's Hive-site.xml
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://10.20.109.213: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>hiveMysqlAb1234567890</value>
</property>
Remember to assign the appropriate permissions to the MySQL hive user.
GRANT all privileges the hive.* to [e-mail protected] identified by "Hive";
GRANT all privileges the hive.* to [email protected]'% ' identified by ' hive ';
Then start Hive to
If you encounter error jline related, copy the JLine package under Hive/lib to Lib under the yarn path under Hadoop.
If hive starts with the following error:
Specified key was too long; Max key length is 767 bytes
Then modify the MySQL my.cnf in the character_set_client and Character_set_server, are set to Latin1, do not use Utf-8.
Hive uses MySQL as metadata