apache/seatunnel · error · UnsupportedOperationException

Unsupported MySQL version:

Error message

Unsupported MySQL version: 

What it means

MySqlVersion.parse cannot recognize the version string returned by the MySQL server: it matches the string against known version prefixes (5.x/8.x prefixes enumerated in MySqlVersion) and throws UnsupportedOperationException when none match. The connector needs the version to gate SQL feature usage (e.g. metadata-based split vs INFORMATION_SCHEMA).

Solutions

  1. Use a genuine MySQL server (5.x or 8.x) or one whose version string matches a known prefix.
  2. For MariaDB, use the connector-dm/connector compatible with mariadb or connect via a dialect that accepts its version.
  3. Add the missing versionPrefix to the MySqlVersion enum and rebuild if you must support this fork.

Example fix

// before
url = "jdbc:mysql://host:4000/db"  // TiDB, version not recognized
// after
url = "jdbc:mysql://mysql-host:3306/db"  // genuine MySQL 8.x
Defensive patterns

Strategy: validation

Validate before calling

// Before submitting the job, check the server banner
String version = connection.getMetaData().getDatabaseProductVersion();
if (!(version.startsWith("5.") || version.startsWith("8."))) {
  throw new IllegalArgumentException("MySQL connector expects MySQL 5.x/8.x, got: " + version);
}

Try / catch

try {
  dialect.connect(conn);
} catch (UnsupportedOperationException e) {
  if (e.getMessage().startsWith("Unsupported MySQL version")) {
    // switch dialect/connector to one matching the actual server (MariaDB/TiDB)
  }
}

Prevention

When it happens

Trigger: Connecting to a MySQL-compatible server whose version string does not start with any known prefix — e.g. MariaDB, TiDB, Aurora variant strings, or very new/unusual version numbers.

Common situations: Pointing the MySQL connector at MariaDB (version string '5.5.5-10.x...'); using TiDB or ShardingSphere proxy whose version banner differs; testing against MySQL forks.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/cec988a60fb0fca0. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/mysql/MySqlVersion.java:44

    V_8_2("8.2"),
    V_8_3("8.3"),
    V_8_4("8.4");

    private final String versionPrefix;

    MySqlVersion(String versionPrefix) {
        this.versionPrefix = versionPrefix;
    }

    public static MySqlVersion parse(String version) {
        if (version != null) {
            for (MySqlVersion mySqlVersion : values()) {
                if (version.startsWith(mySqlVersion.versionPrefix)) {
                    return mySqlVersion;
                }
            }
        }
        throw new UnsupportedOperationException("Unsupported MySQL version: " + version);
    }

    public boolean isBefore(MySqlVersion version) {
        return this.compareTo(version) < 0;
    }

    public boolean isAtOrBefore(MySqlVersion version) {
        return this.compareTo(version) <= 0;
    }

    public boolean isAfter(MySqlVersion version) {
        return this.compareTo(version) > 0;
    }

    public boolean isAtOrAfter(MySqlVersion version) {
        return this.compareTo(version) >= 0;
    }
}

View on GitHub (pinned to cf67b549a7)