Installing Hive
1. Download hive-0.11.0.tar.gz, unzip;
2. Download the Mysql-connector-java-5.1.29-bin.jar and put it under hive/lib/;
3. Configure Hive/conf/hive-site.xml
4. Install MySQL:
1). Unzip the installation package, go to the directory where the installation package is located, execute the command: Tar xzf mysql-5.6.27-linux-glibc2.5-x86_64.tar.gz
2). Copy the extracted MySQL directory to the local software directory of the system: Execute command: [root]$ cp-r Mysql-5.6.27-linux-glibc2.5-x86_64.tar.gz/usr/local/mysql
3). Add System MySQL Group and MySQL User: Execute command: [root]$ groupadd MySQL useradd-r-g MySQL MySQL
4) Go to install MySQL software directory: Execute command cd/usr/local/mysql
Modify current directory owner for MySQL User: Execute command chown-r mysql:mysql.
Install database: Executes the command./scripts/mysql_install_db--user=mysql
Modify the current directory owner as root User: Execute command chown-r root:root.
Modify the current data directory owner for MySQL User: Execute command chown-r mysql:mysql data
To this database installation is complete.
5). Start the MySQL service and add the boot MySQL service:
Add Boot: Execute command CP Support-files/mysql.server/etc/init.d/mysql, put startup script into boot initialization directory
Start MySQL service: Execute command service MySQL start
Execute command: ps-ef|grep mysql see MySQL service description started successfully.
6). To modify the root user password of MySQL, the root initial password is empty:
Execute command:./bin/mysqladmin-u root-p
ENTER_PASSWD://Enter the password, and then lose it again
7). Place the MySQL client in the default path:
Ln-s/usr/local/mysql/bin/mysql/usr/local/bin/mysql
5. Configure MySQL to enter MySQL first:
$mysql-U root-p
enter_passwd:123456
Mysql>create user ' hive ' @ '% ' identified by ' hive ';
Mysql>grant all privileges on * * to ' hive ' @ '% ' with GRANT option;
Mysql>flush privileges;
Mysql>create database hive;
6. Start the hive server and execute:
$ hive--service Metastore
7. Re-open a terminal window to start the Hive client:
$hive
Hive (default) > Show tables;
Ok
Tab_name
Time taken:1.574 seconds
At this point, the hive installation is complete, and MySQL is also verified to start normally.
PS: This MySQL version is mysql-5.6.27-linux-glibc2.5-x86_64.tar.gz, can be completed successfully through the above steps. Before downloading a newer version of mysql-5.7.9-linux-glibc2.5-x86_64.tar.gz, the installation process encountered a lot of problems, and the answers provided by netizens are difficult to solve. Therefore, it is recommended to use a slightly older version of the subsequent installation process and pay the price for the new features!
Install hive Step-by-step