Sqoop the data from MySQL to Hive and reported that the database access was denied. But the weird is, sqoop error is prompted to connect to the local MySQL was rejected, is not prompted to connect the target data MySQL is denied. I also connected to the zookeeper, will also be prompted to connect all the zookeeper host MySQL is denied. Log as below.
In fact, these problems are a reason, that is, the target data is the MySQL limit zookeeper host to access it. You only need to authorize it on this MySQL.
Perform
Grant all privileges on * * to [email protected] '% ' identified by ' password '; flush privileges;
Error log:
15/09/17 10:51:30 error manager. Sqlmanager: error executing statement: java.sql.sqlexception: access denied for user ' Hadoop ' @ ' 192.168.1.110 ' (using password: yes) Java.sql.SQLException: Access denied for user ' Hadoop ' @ ' 192.168.1.110 ' (using password: yes) at com.mysql.jdbc.sqlerror.createsqlexception ( sqlerror.java:1094) at Com.mysql.jdbc.MysqlIO.checkErrorPacket (mysqlio.java:4208) at com.mysql.jdbc.mysqlio.checkerrorpacket (mysqlio.java:4140) at com.mysql.jdbc.mysqlio.checkerrorpacket (mysqlio.java:925) at com.mysql.jdbc.mysqlio.proceedhandshakewithpluggableauthentication (MysqlIO.java:1747) at com.mysql.jdbc.mysqlio.dohandshake (mysqlio.java:1287) at com.mysql.jdbc.connectionimpl.coreconnect (connectionimpl.java:2494) at com.mysql.jdbc.connectionimpl.connectonetryonly ( connectionimpl.java:2527) at Com.mysql.jdbc.ConnectionImpl.createNewIO (connectionimpl.java:2309) at com.mysql.jdbc.ConnectionImpl.<init> (connectionimpl.java:834) at com.mysql.jdbc.JDBC4Connection.<init> (jdbc4connection.java:46) at sun.reflect.nativeconstructoraccessorimpl.newinstance0 ( Native method) at Sun.reflect.NativeConstructorAccessorImpl.newInstance (nativeconstructoraccessorimpl.java:57) &nbSp; at sun.reflect.delegatingconstructoraccessorimpl.newinstance ( DELEGATINGCONSTRUCTORACCESSORIMPL.JAVA:45) at Java.lang.reflect.Constructor.newInstance (constructor.java:526) at com.mysql.jdbc.util.handlenewinstance (util.java:408) at com.mysql.jdbc.connectionimpl.getinstance (connectionimpl.java:419) at com.mysql.jdbc.nonregisteringdriver.connect (nonregisteringdriver.java:344) at java.sql.drivermanager.getconnection (DriverManager.java:571) at java.sql.drivermanager.getconnection ( drivermanager.java:215) at Org.apache.sqoop.manager.SqlManager.makeConnection (sqlmanager.java:885) &NBSP;&NBSP;&NBSP;&NBSP;&NBSp; at org.apache.sqoop.manager.genericjdbcmanager.getconnection (GenericJdbcManager.java : 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.getColumnTypesForQuery (sqlmanager.java:234) at org.apache.sqoop.manager.connmanager.getcolumntypes (ConnManager.java:304) 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) 15/09/17 10:51:30 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)
Sqoop data from MySQL to hive, reporting database access denied