java.sql.SQLNonTransientConnectionException: CLIENT_PLUGIN_AUTH is required

2016-06-14 09:21:37   作者:MangoCool   来源:MangoCool

使用sqoop工具,将mysql-connector-java-6.0.2.jar版本的驱动包加入sqoop的lib包中。

执行sqoop命令将mysql数据导入hive中,出现报错:

16/06/13 16:14:23 ERROR manager.SqlManager: Error executing statement: java.sql.SQLNonTransientConnectionException: CLIENT_PLUGIN_AUTH is required
java.sql.SQLNonTransientConnectionException: CLIENT_PLUGIN_AUTH is required
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:676)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:663)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:653)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:638)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:606)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:624)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:620)
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:71)
        at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:1683)
        at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:656)
        at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:349)
        at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:221)
        at java.sql.DriverManager.getConnection(DriverManager.java:664)
        at java.sql.DriverManager.getConnection(DriverManager.java:247)
        at org.apache.sqoop.manager.SqlManager.makeConnection(SqlManager.java:885)
        at org.apache.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:52)
        at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:744)
        at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:767)
        at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:270)
        at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:241)
        at org.apache.sqoop.manager.SqlManager.getColumnTypes(SqlManager.java:227)
        at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:295)
        at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1833)
        at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1645)
        at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107)
        at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478)
        at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:605)
        at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
        at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
        at org.apache.sqoop.Sqoop.main(Sqoop.java:236)
Caused by: com.mysql.cj.core.exceptions.UnableToConnectException: CLIENT_PLUGIN_AUTH is required
        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:422)
        at com.mysql.cj.core.exceptions.ExceptionFactory.createException(ExceptionFactory.java:54)
        at com.mysql.cj.core.exceptions.ExceptionFactory.createException(ExceptionFactory.java:73)
        at com.mysql.cj.mysqla.io.MysqlaProtocol.rejectConnection(MysqlaProtocol.java:293)
        at com.mysql.cj.mysqla.authentication.MysqlaAuthenticationProvider.connect(MysqlaAuthenticationProvider.java:199)
        at com.mysql.cj.mysqla.io.MysqlaProtocol.connect(MysqlaProtocol.java:1712)
        at com.mysql.cj.mysqla.MysqlaSession.connect(MysqlaSession.java:149)
        at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:1803)
        at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:1673)
        ... 24 more
16/06/13 16:14:23 ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: No columns to generate for ClassWriter
        at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1651)
        at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107)
        at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478)
        at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:605)
        at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
        at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
        at org.apache.sqoop.Sqoop.main(Sqoop.java:236)


解决办法:

重新用回mysql-connector-java-5.x.jar版本的即可。

下载地址:http://central.maven.org/maven2/mysql/mysql-connector-java/5.1.38/mysql-connector-java-5.1.38.jar


参考来源:

http://stackoverflow.com/questions/37348572/new-mysql-driver-causes-java-sql-sqlnontransientconnectionexception-client-plug

标签: Sqoop Hive MySQL

分享:

上一篇org.kitesdk.data.DatasetNotFoundException: Unknown dataset URI: hive:/xbdp/tb_machine. Check that JARs for hive datasets are on the classpath.

下一篇java.sql.SQLException: Streaming result set com.mysql.jdbc.RowDataDynamic@70e8f8e is still active. No statements may be issued when any streaming result sets are open and in use on a given connection. Ensure that you have called .close() on any active streaming result sets before attempting more queries.

关于我

一个喜欢唱歌,热衷旅行,爱好电子产品的码农。没事,跟三五好友吼上几嗓子,约上几个背着行囊去露营或者宅在家里抱着孩子敲代码。

座右铭:当你的才华还撑不起你的野心的时候,你就应该静下心来学习,永不止步!

            人生之旅历途甚长,所争决不在一年半月,万不可因此着急失望,招精神之萎葸。


Copyright 芒果酷(mangocool.com) All rights reserved. 湘ICP备14019394号

免责声明:本网站部分文章转载其他媒体,意在为公众提供免费服务。如有信息侵犯了您的权益,可与本网站联系,本网站将尽快予以撤除。