{"record":{"id":"a5341faad412e941","repo":"apache/seatunnel","slug":"error-reading-mysql-variables-e-getmessage-a5341f","errorCode":null,"errorMessage":"Error reading MySQL variables: ${e.getMessage()}","messagePattern":"Error reading MySQL variables: (.+?)","errorType":"exception","errorClass":"SeaTunnelException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mysql/source/MySqlDialect.java","lineNumber":75,"sourceCode":"    private transient MySqlSchema mySqlSchema;\n    private final Map<TableId, CatalogTable> tableMap;\n\n    public MySqlDialect(MySqlSourceConfigFactory configFactory, List<CatalogTable> catalogTables) {\n        this.sourceConfig = configFactory.create(0);\n        this.tableMap = CatalogTableUtils.convertTables(catalogTables);\n    }\n\n    @Override\n    public String getName() {\n        return DatabaseIdentifier.MYSQL;\n    }\n\n    @Override\n    public boolean isDataCollectionIdCaseSensitive(JdbcSourceConfig sourceConfig) {\n        try (JdbcConnection jdbcConnection = openJdbcConnection(sourceConfig)) {\n            return isDataCollectionIdCaseSensitive(jdbcConnection);\n        } catch (SQLException e) {\n            throw new SeaTunnelException(\"Error reading MySQL variables: \" + e.getMessage(), e);\n        }\n    }\n\n    private boolean isDataCollectionIdCaseSensitive(JdbcConnection jdbcConnection) {\n        return isTableIdCaseSensitive(jdbcConnection);\n    }\n\n    @Override\n    public JdbcConnection openJdbcConnection(JdbcSourceConfig sourceConfig) {\n        return MySqlConnectionUtils.createMySqlConnection(sourceConfig.getDbzConfiguration());\n    }\n\n    @Override\n    public ChunkSplitter createChunkSplitter(JdbcSourceConfig sourceConfig) {\n        return new MySqlChunkSplitter(sourceConfig, this);\n    }\n\n    @Override","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mysql/source/MySqlDialect.java#L57-L93","documentation":"MySqlDialect.isDataCollectionIdCaseSensitive opens a JDBC connection and queries server variables (lower_case_table_names) to determine whether table names are case sensitive. Any SQLException from opening the connection or running the query is wrapped in a SeaTunnelException with this message, with the original SQLException as cause.","triggerScenarios":"SQLException while opening the JDBC connection or reading MySQL variables inside isDataCollectionIdCaseSensitive — bad credentials, unreachable host/port, unknown database, SSL mismatch, or socket timeout.","commonSituations":"Wrong hostname/port in config; MySQL account access denied; firewall or security group blocking 3306; useSSL incompatibility with server; DNS resolution failure at job startup.","solutions":["Read the cause SQLException for the root reason (Access denied, Communications link failure, Unknown database) and fix accordingly.","Verify hostname, port, username, password, and database in the source config; test with a mysql client from the same host.","Align SSL settings (useSSL/requireSSL) with the server's TLS requirements.","Check network/firewall rules and increase connectTimeout if the network is slow."],"exampleFix":"// before\nurl = \"jdbc:mysql://wrong-host:3306/mydb\"\n// after\nurl = \"jdbc:mysql://mysql-prod.internal:3306/mydb\"  // reachable host, matching credentials","handlingStrategy":"try-catch","validationCode":"// Pre-flight connectivity check\ntry (Connection c = DriverManager.getConnection(url, user, pass)) {\n    c.createStatement().executeQuery(\"SHOW VARIABLES LIKE 'lower_case_table_names'\");\n}","typeGuard":null,"tryCatchPattern":"try { dialect.isDataCollectionIdCaseSensitive(config); } catch (SeaTunnelException e) { logger.error(\"MySQL variable read failed: {}\", e.getCause().getMessage()); throw e; }","preventionTips":["Run a connection smoke test in CI against the target MySQL host/port.","Keep credentials in a secret store and rotate without typos.","Match SSL settings (useSSL) between client and server."],"tags":["mysql","jdbc","connection","case-sensitivity"],"backgroundTag":"connection-refused","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"}