aqi915 发表于 2015-9-14 17:58:58

sqoop 从mysql导入到hdfs时报错

执行下面语句:
sqoop import --connect jdbc:mysql://ktbigdata1:3306/sqoop --username root --password 123456 --table tb1 -m 1

报下面错误:数据节点没有在ktbigdata1这个权限问题应该怎么解决呢?


15/09/14 17:43:33 INFO mapreduce.Job: Task Id : attempt_1441875868945_0129_m_000000_1, Status : FAILED
Error: java.lang.RuntimeException: java.lang.RuntimeException: java.sql.SQLException: Access denied for user 'root'@'ktbigdata2' (using password: YES)
      at org.apache.sqoop.mapreduce.db.DBInputFormat.setConf(DBInputFormat.java:167)
      at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:76)
      at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136)
      at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:749)
      at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
      at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.security.auth.Subject.doAs(Subject.java:415)
      at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
      at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: java.lang.RuntimeException: java.sql.SQLException: Access denied for user 'root'@'ktbigdata2' (using password: YES)
      at org.apache.sqoop.mapreduce.db.DBInputFormat.getConnection(DBInputFormat.java:220)
      at org.apache.sqoop.mapreduce.db.DBInputFormat.setConf(DBInputFormat.java:165)
      ... 9 more
Caused by: java.sql.SQLException: Access denied for user 'root'@'ktbigdata2' (using password: YES)
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3847)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3783)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:871)
      at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1665)
      at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1207)
      at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2249)
      at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2280)
      at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2079)
      at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:794)
      at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      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:400)
      at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399)
      at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)
      at java.sql.DriverManager.getConnection(DriverManager.java:571)
      at java.sql.DriverManager.getConnection(DriverManager.java:215)
      at org.apache.sqoop.mapreduce.db.DBConfiguration.getConnection(DBConfiguration.java:302)
      at org.apache.sqoop.mapreduce.db.DBInputFormat.getConnection(DBInputFormat.java:213)
      ... 10 more


mituan2008 发表于 2015-9-14 18:18:24

mysql设置允许远程访问

aqi915 发表于 2015-9-14 18:27:47

mituan2008 发表于 2015-9-14 18:18
mysql设置允许远程访问

可以具体点么?没用过,麻烦了!!!

mituan2008 发表于 2015-9-14 18:35:43

方法很多,网上也有的进入mysql

mysql -u root -p

mysql>use mysql;
mysql>update user set host = '%' where user = 'root';
mysql>select host, user from user;   


aqi915 发表于 2015-9-14 18:43:29

mituan2008 发表于 2015-9-14 18:35
方法很多,网上也有的进入mysql

mysql -u root -p


恩恩,刚查了,解决了,谢谢啦
页: [1]
查看完整版本: sqoop 从mysql导入到hdfs时报错