本文主要是介绍Flink jdbc报错:Access Denied for user ‘root‘@‘10.0.0.x‘ (using password: YES),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
报错信息:
2021-12-31 11:02:51.955 [Source: TableSourceScan(table=[[default_catalog, default_database, jdbc_source_table, project=[id]]], fields=[id]) -> Calc(select=[id, id AS id0, id AS id1]) -> Sink: Sink(table=[default_catalog.default_database.jdbc_upsert_sink_table], fields=[id, id0, id1]) (1/1)#1] WARN org.apache.flink.runtime.taskmanager.Task - Source: TableSourceScan(table=[[default_catalog, default_database, jdbc_source_table, project=[id]]], fields=[id]) -> Calc(select=[id, id AS id0, id AS id1]) -> Sink: Sink(table=[default_catalog.default_database.jdbc_upsert_sink_table], fields=[id, id0, id1]) (1/1)#1 (85391b7c05a5282974f4da4cbb62f38e) switched from INITIALIZING to FAILED with failure cause: java.io.IOException: unable to open JDBC writerat org.apache.flink.connector.jdbc.internal.AbstractJdbcOutputFormat.open(AbstractJdbcOutputFormat.java:56)at org.apache.flink.connector.jdbc.internal.JdbcBatchingOutputFormat.open(JdbcBatchingOutputFormat.java:129)at org.apache.flink.connector.jdbc.internal.GenericJdbcSinkFunction.open(GenericJdbcSinkFunction.java:60)at org.apache.flink.api.common.functions.util.FunctionUtils.openFunction(FunctionUtils.java:34)at org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.open(AbstractUdfStreamOperator.java:102)at org.apache.flink.table.runtime.operators.sink.SinkOperator.open(SinkOperator.java:58)at org.apache.flink.streaming.runtime.tasks.OperatorChain.initializeStateAndOpenOperators(OperatorChain.java:442)at org.apache.flink.streaming.runtime.tasks.StreamTask.restoreGates(StreamTask.java:582)at org.apache.flink.streaming.runtime.tasks.StreamTaskActionExecutor$SynchronizedStreamTaskActionExecutor.call(StreamTaskActionExecutor.java:100)at org.apache.flink.streaming.runtime.tasks.StreamTask.executeRestore(StreamTask.java:562)at org.apache.flink.streaming.runtime.tasks.StreamTask.runWithCleanUpOnFail(StreamTask.java:647)at org.apache.flink.streaming.runtime.tasks.StreamTask.restore(StreamTask.java:537)at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:759)at org.apache.flink.runtime.taskmanager.Task.run(Task.java:566)at java.lang.Thread.run(Thread.java:748)
Caused by: java.sql.SQLException: Access denied for user 'root'@'10.0.0.23' (using password: YES)at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:836)at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456)at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:197)at org.apache.flink.connector.jdbc.internal.connection.SimpleJdbcConnectionProvider.getOrEstablishConnection(SimpleJdbcConnectionProvider.java:121)at org.apache.flink.connector.jdbc.internal.AbstractJdbcOutputFormat.open(AbstractJdbcOutputFormat.java:54)... 14 more
可能问题:
- connector with 参数连接信息错误。
- 数据库中表字段类型与flink SQL 中定义不匹配,导致表连接失败。
这篇关于Flink jdbc报错:Access Denied for user ‘root‘@‘10.0.0.x‘ (using password: YES)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!