配置hive与mysql_Hive安装配置及与mysql结合应用

OKhwz2Time taken: 0.419 secondshive> load data local inpath 'demo.txt' overwrite into table hwz2;Copying data from file:/home/hadoop/demo.txtCopying file: file:/home/hadoop/demo.txtLoading data to table dw2.hwz2Deleted hdfs://master:9000/user/hive/warehouse/dw2.db/hwz2OKTime taken: 0.557 secondshive> select * from hwz2;OK12 jack12 jack12 jack12 jack12 jack12 jack12 jack12 jack$ hadoop dfs -lsr /user/hiveWarning: $HADOOP_HOME is deprecated.drwxr-xr-x - hadoop supergroup 0 2012-03-22 15:36 /user/hive/warehousedrwxr-xr-x - hadoop supergroup 0 2012-03-22 15:48 /user/hive/warehouse/dw2.dbdrwxr-xr-x - hadoop supergroup 0 2012-03-22 15:48 /user/hive/warehouse/dw2.db/hwz2-rw-r--r-- 2 hadoop supergroup 1201 2012-03-22 15:48 /user/hive/warehouse/dw2.db/hwz2/demo.txtdrwxr-xr-x - hadoop supergroup 0 2012-03-22 12:36 /user/hive/warehouse/hwzdrwxr-xr-x - hadoop supergroup 0 2012-03-22 15:36 /user/hive/warehouse/hwz2-rw-r--r-- 2 hadoop supergroup 1201 2012-03-22 15:36 /user/hive/warehouse/hwz2/demo.txt$ hadoop dfs -cat /user/hive/warehouse/dw2.db/hwz2/demo.txt |headWarning: $HADOOP_HOME is deprecated.12,jack12,jack12,jack12,jack12,jack12,jack12,jack12,jack12,jack12,jackd. 在mysql中验证建立的新表mysql> use hive;Database changedmysql> show tables;+-----------------+| Tables_in_hive |+-----------------+| BUCKETING_COLS || CDS || COLUMNS_V2 || DATABASE_PARAMS || DBS || PARTITION_KEYS || SDS || SD_PARAMS || SEQUENCE_TABLE || SERDES || SERDE_PARAMS || SORT_COLS || TABLE_PARAMS || TBLS |+-----------------+14 rows in set (0.00 sec)9. 常见错误error 1:-------------------------------------------------hive> show tables;FAILED: Error in metadata: javax.jdo.JDOFatalInternalException: Error creating transactional connection factorySolution:Hive不带mysql JDBC驱动,自己安装:wget http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.18.tar.gz/from/http://mysql.mirror.kangaroot.net/tar zxf mysql-connector-java-5.1.18.tar.gzcd mysql-connector-java-5.1.18cp mysql-connector*.jar $HIVE_HOME/liberror 2:-------------------------------------------------hive> show tables;FAILED: Error in metadata: javax.jdo.JDOException: Couldnt obtain a new sequence (unique id) : Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.Solution:在mysql中设置 binlog_format='MIXED'

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值