将talnd连接到mysql[事务只读状态服务器]

3okqufwl  于 2021-06-20  发布在  Mysql
关注(0)|答案(1)|浏览(391)

我正在尝试将talend(版本7.0.1)连接到mysql server(版本8.0.12),我可以成功地连接到数据库并执行简单的select查询。但是,当我尝试执行批量插入时,会出现以下异常:

Starting job A_2_ProcessRestData_NEW at 17:59 20/08/2018.

[statistics] connecting to socket on port 3407
[statistics] connected
Exception in component tDBOutputBulkExec_1_tMBE (A_2_ProcessRestData_NEW)
java.sql.SQLException: Could not retrieve transation read-only status server
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1084)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:973)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:918)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:949)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:939)
    at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3976)
    at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3947)
    at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:813)
    at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:788)
    at living_dashboard.a_2_processrestdata_new_0_1.A_2_ProcessRestData_NEW.tFileInputDelimited_1Process(A_2_ProcessRestData_NEW.java:4671)
    at living_dashboard.a_2_processrestdata_new_0_1.A_2_ProcessRestData_NEW.runJobInTOS(A_2_ProcessRestData_NEW.java:6955)
    at living_dashboard.a_2_processrestdata_new_0_1.A_2_ProcessRestData_NEW.main(A_2_ProcessRestData_NEW.java:6733)
Caused by: java.sql.SQLException: Unknown system variable 'tx_read_only'
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1084)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4232)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4164)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2615)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2776)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2832)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2781)
    at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1569)
    at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3970)
    ... 6 more
[statistics] disconnected

Job A_2_ProcessRestData_NEW ended at 17:59 20/08/2018. [exit code=1]

你知道可能是什么吗?
提前谢谢

wfveoks0

wfveoks01#

我最终解决了这个问题。事实证明,要使用的db版本不能是我刚才指定的MySQL5。我需要改用mariadb。问题已解决;)

相关问题