{"record":{"id":"7fe6ba936d048ce8","repo":"apache/seatunnel","slug":"unexpected-error-while-connecting-to-mysql-and-loo-7fe6ba","errorCode":null,"errorMessage":"Unexpected error while connecting to MySQL and looking at BINLOG_ROW_IMAGE mode: ","messagePattern":"Unexpected error while connecting to MySQL and looking at BINLOG_ROW_IMAGE mode: ","errorType":"exception","errorClass":"DebeziumException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/io/debezium/connector/mysql/MySqlConnection.java","lineNumber":435,"sourceCode":"     *     {@code false} otherwise\n     */\n    protected boolean isBinlogRowImageFull() {\n        try {\n            final String rowImage =\n                    queryAndMap(\n                            \"SHOW GLOBAL VARIABLES LIKE 'binlog_row_image'\",\n                            rs -> {\n                                if (rs.next()) {\n                                    return rs.getString(2);\n                                }\n                                // This setting was introduced in MySQL 5.6+ with default of 'FULL'.\n                                // For older versions, assume 'FULL'.\n                                return \"FULL\";\n                            });\n            LOGGER.debug(\"binlog_row_image={}\", rowImage);\n            return \"FULL\".equalsIgnoreCase(rowImage);\n        } catch (SQLException e) {\n            throw new DebeziumException(\n                    \"Unexpected error while connecting to MySQL and looking at BINLOG_ROW_IMAGE mode: \",\n                    e);\n        }\n    }\n\n    /**\n     * Determine whether the MySQL server has the row-level binlog enabled.\n     *\n     * @return {@code true} if the server's {@code binlog_format} is set to {@code ROW}, or {@code\n     *     false} otherwise\n     */\n    protected boolean isBinlogFormatRow() {\n        try {\n            final String mode =\n                    queryAndMap(\n                            \"SHOW GLOBAL VARIABLES LIKE 'binlog_format'\",\n                            rs -> rs.next() ? rs.getString(2) : \"\");\n            LOGGER.debug(\"binlog_format={}\", mode);","sourceCodeStart":417,"sourceCodeEnd":453,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/io/debezium/connector/mysql/MySqlConnection.java#L417-L453","documentation":"isBinlogRowImageChecking queries binlog_row_image (SHOW GLOBAL VARIABLES) to confirm it is FULL, and wraps any SQLException into this DebeziumException. Without reading this variable the connector cannot verify that row images contain the before/after data CDC requires.","triggerScenarios":"SQLException while executing the binlog_row_image query inside isBinlogRowImageChecking — lost connection, bad credentials, or statement rejected.","commonSituations":"Startup validation after a DB restart or failover; user lacking privileges for SHOW GLOBAL VARIABLES; intermittent network problems.","solutions":["Reconnect/verify MySQL connectivity and credentials","Grant privileges to run SHOW GLOBAL VARIABLES","Check the cause SQLException for the root error","Set binlog_row_image=FULL on the server (separate from fixing the query failure)"],"exampleFix":"// before\nSET GLOBAL binlog_row_image = 'MINIMAL';\n// after\nSET GLOBAL binlog_row_image = 'FULL';","handlingStrategy":"retry","validationCode":"try (Statement s = conn.createStatement()) { ResultSet rs = s.executeQuery(\"SHOW GLOBAL VARIABLES LIKE 'binlog_row_image'\"); rs.next(); if (!\"FULL\".equals(rs.getString(2))) { throw new IllegalStateException(\"binlog_row_image must be FULL\"); } }","typeGuard":null,"tryCatchPattern":"catch (DebeziumException e) { logger.error(\"binlog_row_image check failed\", e.getCause()); retryWithBackoff(); }","preventionTips":["Set binlog_row_image=FULL in MySQL config (my.cnf, not just runtime)","Grant global variable read privileges to the CDC user","Health-check DB connectivity before starting the connector","Re-verify server settings after failovers"],"tags":["mysql","binlog","jdbc","cdc"],"backgroundTag":"database-query-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}