hive 连接数据库mysql配置问题

[root@c167 conf]# hive
which: no hbase in (/bin:/usr/bin:/usr/local/rvm/gems/ruby-2.3.8/bin:/usr/local/rvm/gems/ruby-2.3.8@global/bin:/usr/local/rvm/rubies/ruby-2.3.8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/rvm/bin:/usr/local/java/jdk1.8.0_191/bin:/data/hive/bin:/data/hadoop/bin:/data/sqoop/sqoop-1.4.7/bin:/data/spark-2.1.0-bin-hadoop2.6/bin:/data/scala/scala-2.10.7/bin:/root/bin)
[Fatal Error] hive-site.xml:36:78: The reference to entity "useSSL" must end with the ';' delimiter.
Exception in thread "main" java.lang.RuntimeException: org.xml.sax.SAXParseException; systemId: file:/data/hive/conf/hive-site.xml; lineNumber: 36; columnNumber: 78; The reference to entity "useSSL" must end with the ';' delimiter.
        at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2517)
        at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2374)
        at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2281)
        at org.apache.hadoop.conf.Configuration.get(Configuration.java:1108)
        at org.apache.hadoop.hive.conf.HiveConf.getVar(HiveConf.java:3904)
        at org.apache.hadoop.hive.conf.HiveConf.getVar(HiveConf.java:3973)
        at org.apache.hadoop.hive.conf.HiveConf.initialize(HiveConf.java:4060)
        at org.apache.hadoop.hive.conf.HiveConf.<init>(HiveConf.java:4003)
        at org.apache.hadoop.hive.common.LogUtils.initHiveLog4jCommon(LogUtils.java:81)
        at org.apache.hadoop.hive.common.LogUtils.initHiveLog4j(LogUtils.java:65)
        at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:702)
        at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:686)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: org.xml.sax.SAXParseException; systemId: file:/data/hive/conf/hive-site.xml; lineNumber: 36; columnNumber: 78; The reference to entity "useSSL" must end with the ';' delimiter.
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:150)
        at org.apache.hadoop.conf.Configuration.parse(Configuration.java:2352)
        at org.apache.hadoop.conf.Configuration.parse(Configuration.java:2340)
        at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2408)
        ... 17 more

在运行hive命令时出现上述错误,原因是hive-site.xml配置连接数据库mysql字符串值中 & 符合需要转义。将 & 转义为 &amp; 即可。

原来是:

jdbc:mysql://localhost:3306/hive?characterEncoding=UTF-8&useSSL=false&createDatabaseIfNotExist=true

修改后:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值