This article is based on the previous post: Hive Environment Setup and testing
First, root User: upload the MySQL installation package (mysql-5.5.32.tar.gz) to the/install directory and unzip the installation;
ii.hadoop User: upload MySQL driver pack (Mysql-connector-java-3.0.17-ga-bin.jar) to/software/hive-1.2.2/lib
To modify the configuration file for hive:
Vi/software/hive-1.2.2/conf/hive-site.xml
To change the database connection mode:
394 <property>395 <name>javax.jdo.option.connectionurl</name>396 <!--<value>jdbc:derby :;d atabasename=metastore_db;create=true</value>-->397 <value>jdbc:mysql:// 192.168.154.134:3306/hive?createdatabaseifnotexist=true&characterencoding=utf8</value> for a JDBC metastore</description>399 </property>
Change driver:
class for a JDBC metastore</description>794 </property>
Change Login Name:
815 <property>816 <name>javax.jdo.option.connectionusername</name>817 <!--<value>APP </value>-->818 <value>root</value>819 <description>username to use against Metastore database</description>820 </property>
To change the login secret code:
379 <property>380 <name>javax.jdo.option.connectionpassword</name>381 <!--<value>mine </value>-->382 <value>123456</value>383 <description>password to use against Metastore database</description>384 </property>
The change log format is in binary format:
Vi/etc/my.cnf
mixed#binlog_format = Binlog_format=row
Third, test the installation is successful:
Root User under:
Cd/software/mysql-5.5.32/sbin
lsof-i:3306 // to see if the boot was successful
Cd/software/mysql-5.5.32/bin
//must be latin1; because Hive does not support Utf-8./mysql-uroot-p123456-e "Show databases;" // shows whether the database was created successfully
Hive Default Database Modification configuration