Support Questions

Find answers, ask questions, and share your expertise

while importing data from mysql to HDFS getting below error

avatar
Explorer

18/11/25 19:13:08 ERROR manager.SqlManager: Error executing statement: java.sql.SQLException: Access denied for user 'root'@'localhost' java.sql.SQLException: Access denied for user 'root'@'localhost' at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:695) 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.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:115) at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:1663) at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:662) at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:352) 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) 18/11/25 19:13:08 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)

1 REPLY 1

avatar
Master Mentor

@Veera Mundra

Please make sure that you are using correct MySQL root user credentials and able to logint o mysql using the "mysql client" as following:

# mysql -u root -p
Enter Password: <What_Ever_Is_Your_Root_Password>

.

If you do not know your root user password for mysql then you can reset it as mentioned in: https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html

Stop the MySQL server if necessary, then restart it with the--skip-grant-tablesoption. This enables anyone to connect without a password and with all privileges, and disables account-management statements such asALTER USERandSET PASSWORD. Because this is insecure, if the server is started with the--skip-grant-tablesoption, it enables--skip-networkingautomatically to prevent remote connections

  1. Connect to the MySQL server using themysqlclient; no password is necessary because the server was started with--skip-grant-tables:
    shell> mysql
  2. In themysqlclient, tell the server to reload the grant tables so that account-management statements work:

    mysql> FLUSH PRIVILEGES

  3. mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';

.

Also please refer to : https://stackoverflow.com/questions/17975120/access-denied-for-user-rootlocalhost-using-password-yes...