Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Sqoop >> mail # user >> mysql and sqoop does not work


+
Chalcy 2012-07-18, 20:54
+
ablozhou@...) 2012-07-19, 02:25
Copy link to this message
-
Re: mysql and sqoop does not work
Hi Chalcy,
Can you try using connection string in this format:
http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html

E.g. jdbc:mysql://localhost/myfirstdb?user=root&password=mypassword

Thanks,
Abhijeet
On 19 Jul 2012 07:56, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:

> Hi,Chalcy,
>
> You should grant privileges to the user.
>
> GRANT ALL PRIVILEGES ON *.* TO '%'@'%';
> GRANT ALL PRIVILEGES ON *.* TO ''@'%';
>
> if it doesn't work, you should use the true ip of database like:
> jdbc:mysql://192.168.10.12/databases.
>
> good luck.
>
> andy
> http://abloz.com
>
>
>
> 2012/7/19 Chalcy <[EMAIL PROTECTED]>
>
>>   Hi,
>>
>> I am trying to set up a stand alone hadoop cluster and sqoop.  I
>> installed mysql, mysql driver, created a new database and a new table and
>> gave permissions etc.,
>>
>> I could do the below,
>>  mysql --host=localhost --database=myfirstdb --user=root
>> --password=mypassword
>>
>> Then I do show databases and I get all the dbs including myfirstdb.
>>
>> Then tried to sqoop like below,
>> sqoop list-tables --verbose --connect
>> jdbc:mysql://localhost/myfirstdb;username=root;password=mypassword;
>>
>>
>> This errors out and I'll the stack trace below.  It seems like not
>> finding the database.
>>
>> Any suggestion is helpful.
>>
>> Thanks,
>> Chalcy
>>
>> ERROR manager.CatalogQueryManager: Failed to list tables
>> com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied
>> for user ''@'localhost' to database 'myfirstdb'
>>  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>> at
>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>>  at
>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>>  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:1053)
>> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4074)
>>  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4006)
>> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:919)
>>  at
>> com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1694)
>> at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1244)
>>  at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2397)
>> at
>> com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2430)
>>  at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2215)
>> at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:813)
>>  at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>>  at
>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>> at
>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>>  at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>> at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
>>  at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399)
>> at
>> com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:334)
>>  at java.sql.DriverManager.getConnection(DriverManager.java:582)
>> at java.sql.DriverManager.getConnection(DriverManager.java:207)
>>  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.listTables(CatalogQueryManager.java:102)
>> at com.cloudera.sqoop.tool.ListTablesTool.run(ListTablesTool.java:51)
>>  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)
+
Chalcy 2012-07-20, 16:23