将talnd连接到MySQL [转换只读状态服务器]

时间:2018-08-20 17:14:40

标签: mysql talend

我正在尝试将Talend(7.0.1版)连接到MySQL Server(8.0.12版),我可以成功连接数据库并对其执行简单的选择查询。但是,当我尝试执行批量插入时,会出现以下异常:

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]

您对可能会有什么线索吗?

预先感谢

1 个答案:

答案 0 :(得分:0)

我终于解决了这个问题。事实证明,要使用的 DB版本不能为MySQL 5 。我需要改用 MariaDB 。问题解决了;)