TECH SOLUTIONS

Click here to edit subtitle

Forums

Post Reply
Forum Home > Bigdata Learnings( Hadoop, HBase,Hive and other bigdata technologies) > when i m trying to import table from mysql to hbase i m getting below shown error pease help

rajesh gupta
Member
Posts: 2

mysql> use testhadoop;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

 

Database changed

mysql> grant all privileges on testhadoop.* to '%'@'localhost';

Query OK, 0 rows affected (0.14 sec)

 

mysql> grant all privileges on testhadoop.* to '%''localhost';

Query OK, 0 rows affected (0.01 sec)

 

mysql> select * from his;

+------+------+------+

| id   | name | sal  |

+------+------+------+

|    1 | emp1 | 1000 |

|    2 | emp2 | 2000 |

|    3 | emp3 | 3000 |

+------+------+------+

3 rows in set (0.00 sec)

 

mysql> quit

Bye

[email protected]:~$ sqoop import --hbase-create-table  --hbase-table myemployee --column-family info --hbase-row-key empid --connect jdbc:mysql://localhost/testhadoop --table his -m 1

13/08/07 15:21:01 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.

13/08/07 15:21:01 INFO tool.CodeGenTool: Beginning code generation

13/08/07 15:21:01 ERROR manager.SqlManager: Error executing statement: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user ''@'localhost' to database 'testhadoop'

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user ''@'localhost' to database 'testhadoop'

    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:532)

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

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

    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)

    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4187)

    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4119)

    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:927)

    at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1709)

    at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1252)

    at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2483)

    at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2516)

    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2301)

    at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:834)

    at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)

    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:532)

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

    at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416)

    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:346)

    at java.sql.DriverManager.getConnection(DriverManager.java:620)

    at java.sql.DriverManager.getConnection(DriverManager.java:222)

    at com.cloudera.sqoop.manager.SqlManager.makeConnection(SqlManager.java:662)

    at com.cloudera.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:53)

    at com.cloudera.sqoop.manager.SqlManager.execute(SqlManager.java:524)

    at com.cloudera.sqoop.manager.SqlManager.execute(SqlManager.java:547)

    at com.cloudera.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:191)

    at com.cloudera.sqoop.manager.SqlManager.getColumnTypes(SqlManager.java:175)

    at com.cloudera.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:263)

    at com.cloudera.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1226)

    at com.cloudera.sqoop.orm.ClassWriter.generate(ClassWriter.java:1051)

    at com.cloudera.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:84)

    at com.cloudera.sqoop.tool.ImportTool.importTable(ImportTool.java:370)

    at com.cloudera.sqoop.tool.ImportTool.run(ImportTool.java:456)

    at com.cloudera.sqoop.Sqoop.run(Sqoop.java:146)

    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)

    at com.cloudera.sqoop.Sqoop.runSqoop(Sqoop.java:182)

    at com.cloudera.sqoop.Sqoop.runTool(Sqoop.java:221)

    at com.cloudera.sqoop.Sqoop.runTool(Sqoop.java:230)

    at com.cloudera.sqoop.Sqoop.main(Sqoop.java:239)

13/08/07 15:21:01 ERROR manager.CatalogQueryManager: Failed to list columns

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user ''@'localhost' to database 'testhadoop'

    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:532)

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

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

    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)

    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4187)

    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4119)

    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:927)

    at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1709)

    at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1252)

    at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2483)

    at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2516)

    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2301)

    at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:834)

    at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)

    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:532)

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

    at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416)

    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:346)

    at java.sql.DriverManager.getConnection(DriverManager.java:620)

    at java.sql.DriverManager.getConnection(DriverManager.java:222)

    at com.cloudera.sqoop.manager.SqlManager.makeConnection(SqlManager.java:662)

    at com.cloudera.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:53)

    at com.cloudera.sqoop.manager.CatalogQueryManager.getColumnNames(CatalogQueryManager.java:147)

    at com.cloudera.sqoop.orm.ClassWriter.getColumnNames(ClassWriter.java:1198)

    at com.cloudera.sqoop.orm.ClassWriter.generate(ClassWriter.java:1053)

    at com.cloudera.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:84)

    at com.cloudera.sqoop.tool.ImportTool.importTable(ImportTool.java:370)

    at com.cloudera.sqoop.tool.ImportTool.run(ImportTool.java:456)

    at com.cloudera.sqoop.Sqoop.run(Sqoop.java:146)

    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)

    at com.cloudera.sqoop.Sqoop.runSqoop(Sqoop.java:182)

    at com.cloudera.sqoop.Sqoop.runTool(Sqoop.java:221)

    at com.cloudera.sqoop.Sqoop.runTool(Sqoop.java:230)

    at com.cloudera.sqoop.Sqoop.main(Sqoop.java:239)

13/08/07 15:21:01 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user ''@'localhost' to database 'testhadoop'

java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user ''@'localhost' to database 'testhadoop'

    at com.cloudera.sqoop.manager.CatalogQueryManager.getColumnNames(CatalogQueryManager.java:163)

    at com.cloudera.sqoop.orm.ClassWriter.getColumnNames(ClassWriter.java:1198)

    at com.cloudera.sqoop.orm.ClassWriter.generate(ClassWriter.java:1053)

    at com.cloudera.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:84)

    at com.cloudera.sqoop.tool.ImportTool.importTable(ImportTool.java:370)

    at com.cloudera.sqoop.tool.ImportTool.run(ImportTool.java:456)

    at com.cloudera.sqoop.Sqoop.run(Sqoop.java:146)

    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)

    at com.cloudera.sqoop.Sqoop.runSqoop(Sqoop.java:182)

    at com.cloudera.sqoop.Sqoop.runTool(Sqoop.java:221)

    at com.cloudera.sqoop.Sqoop.runTool(Sqoop.java:230)

    at com.cloudera.sqoop.Sqoop.main(Sqoop.java:239)

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user ''@'localhost' to database 'testhadoop'

    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:532)

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

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

    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)

    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4187)

    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4119)

    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:927)

    at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1709)

    at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1252)

    at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2483)

    at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2516)

    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2301)

    at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:834)

    at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)

    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:532)

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

    at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416)

    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:346)

    at java.sql.DriverManager.getConnection(DriverManager.java:620)

    at java.sql.DriverManager.getConnection(DriverManager.java:222)

    at com.cloudera.sqoop.manager.SqlManager.makeConnection(SqlManager.java:662)

    at com.cloudera.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:53)

    at com.cloudera.sqoop.manager.CatalogQueryManager.getColumnNames(CatalogQueryManager.java:147)

    ... 11 more

 

 

August 7, 2013 at 5:53 AM Flag Quote & Reply

suneetha
Member
Posts: 4

you need to login as hdfs

su root

type password

then type su hdfs

and run the sqoop command it will work

December 12, 2013 at 12:47 AM Flag Quote & Reply

suneetha
Member
Posts: 4

sqoop import --connect jdbc:mysql://localhost/testhadoop --username xxxx  --table fnd_lobs --password xxxx --hbase-table fndlobs --column-family cf  --hbase-create-table -m1

 


December 12, 2013 at 12:50 AM Flag Quote & Reply

ram
Member
Posts: 3

 

sqoop import --connect jdbc:mysql://localhost/db --username root -P --table name --hbase-table name \

column-family cf --hbase-row-key name --hbase-create-table -m 1

February 4, 2014 at 5:11 AM Flag Quote & Reply

You must login to post.