Mysql版本 Ver 14.14 Distrib 5.6.40, for Linux (x86_64) using EditLine wrapper
Hive版本 apache-hive-2.1.1-bin.tar.gz
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_SELECT_LIMIT=DEFAULT' at line 1)
这个版本用mysql-connector-java-5.1.46-bin.jar!!!!!
下面详细介绍一下具体的安装流程
详情见https://blog.csdn.net/Heitao5200/article/details/80910549
create database if not exists hive_metadata;
grant all privileges on hive_metadata.* to 'hive'@'%' identified by 'hive';
grant all privileges on hive_metadata.* to 'hive'@'localhost' identified by 'hive';
grant all privileges on hive_metadata.* to 'hive'@'master888' identified by 'hive';
flush privileges;
use hive_metadata;
这个版本用mysql-connector-java-5.1.46-bin.jar!!!!!
复制hive-default.xml.template为hive-site.xml
修改连接信息为mysql链接地址,将${system:...字样替换成具体路径。
[hive/conf/hive-site.xml]
mv hive-env.sh.template hive-env.sh
vi /usr/local/hive/bin/hive-config.sh
export JAVA_HOME=/usr/java/latest
export HIVE_HOME=/usr/local/hive
export HADOOP_HOME=/usr/local/hadoop
启动Hadoop
初始化hive的元数据(表结构)到mysql中。
$>cd /soft/hive/bin
$>schematool -dbType mysql -initSchema
直接输入hive命令,可以进入hive命令行
create table users(id int, name string);
load data local inpath '/usr/local/users.txt' into table users;
select name from users;
hive-2.1.1+mysql-connector-java-5.1.46-bin.jar下载连接
https://download.csdn.net/download/heitao5200/10594301