美文网首页数据库
遇到异常com.mysql.jdbc.exceptions.jd

遇到异常com.mysql.jdbc.exceptions.jd

作者: 渡劫CD | 来源:发表于2018-11-09 11:26 被阅读0次

    异常内容:

    FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:javax.jdo.JDODataStoreException: An exception was thrown while adding/validating class(es) : Specified key was too long; max key length is 767 bytes.

        com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes

        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

        at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)

        at com.mysql.jdbc.Util.getInstance(Util.java:381)

    解决办法:

      经过百度查找及自己的实际操作,得到了解决方法如下:

            第一步,删除Hive连接MySQL数据库中存放metastore元数据的数据库:drop database metastore

            第二步,新建存放元数据库的数据:create database metastore

            第三步,修改数据的编码为latin1 :alter database metastorecharacter set latin1

    相关文章

      网友评论

        本文标题:遇到异常com.mysql.jdbc.exceptions.jd

        本文链接:https://www.haomeiwen.com/subject/dbbnxqtx.html