{"record":{"id":"1c45831ae9cbc3ba","repo":"apache/seatunnel","slug":"unexpected-error-while-connecting-to-mysql-and-loo-1c4583","errorCode":null,"errorMessage":"Unexpected error while connecting to MySQL and looking at BINLOG_FORMAT mode: ","messagePattern":"Unexpected error while connecting to MySQL and looking at BINLOG_FORMAT 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":456,"sourceCode":"        }\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);\n            return \"ROW\".equalsIgnoreCase(mode);\n        } catch (SQLException e) {\n            throw new DebeziumException(\n                    \"Unexpected error while connecting to MySQL and looking at BINLOG_FORMAT mode: \",\n                    e);\n        }\n    }\n\n    /**\n     * Query the database server to get the list of the binlog files availble.\n     *\n     * @return list of the binlog files\n     */\n    public List<String> availableBinlogFiles() {\n        List<String> logNames = new ArrayList<>();\n        try {\n            LOGGER.info(\"Get all known binlogs from MySQL\");\n            query(\n                    \"SHOW BINARY LOGS\",\n                    rs -> {\n                        while (rs.next()) {","sourceCodeStart":438,"sourceCodeEnd":474,"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#L438-L474","documentation":"isBinlogFormatRow checks that binlog_format is ROW via SHOW GLOBAL VARIABLES and wraps any SQLException into this DebeziumException. The check ensures the binlog carries row-based events needed for CDC; the exception means the variable lookup itself failed at the SQL level.","triggerScenarios":"SQLException while executing the binlog_format query inside isBinlogFormatRow — connection failure, insufficient privileges, or server rejecting the statement.","commonSituations":"Connector startup against an unreachable or restarting MySQL; CDC user restricted from SHOW GLOBAL VARIABLES; transient network/TLS failures.","solutions":["Verify MySQL connectivity and credentials","Grant the CDC user permission to run SHOW GLOBAL VARIABLES","Inspect the cause SQLException and MySQL server logs","Ensure binlog_format=ROW on the server so replication works once connected"],"exampleFix":"// before\nSET GLOBAL binlog_format = 'STATEMENT';\n// after\nSET GLOBAL binlog_format = 'ROW';","handlingStrategy":"retry","validationCode":"try (Statement s = conn.createStatement()) { ResultSet rs = s.executeQuery(\"SHOW GLOBAL VARIABLES LIKE 'binlog_format'\"); rs.next(); if (!\"ROW\".equals(rs.getString(2))) { throw new IllegalStateException(\"binlog_format must be ROW\"); } }","typeGuard":null,"tryCatchPattern":"catch (DebeziumException e) { logger.error(\"binlog_format check failed\", e.getCause()); retryWithBackoff(); }","preventionTips":["Set binlog_format=ROW persistently in my.cnf","Grant SHOW GLOBAL VARIABLES access to the CDC user","Validate DB reachability before connector startup","Re-check settings after MySQL upgrades/restarts"],"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"}