MyCATApache/Mycat-Server · error · DataMigratorException
dbType: is not support for the moment!
Error message
dbType:{dbType} is not support for the moment! What it means
DataIOFactory.createDataIO is the factory for database IO adapters in the migration tool. Only MySQL (DataMigratorUtil MYSQL constant) is supported; any other dbType string falls through to default and throws a DataMigratorException. MyCat's data migrator simply has no adapter for other databases.
Solutions
- Pass exactly the MYSQL constant value ("mysql") as defined in DataMigratorUtil, matching case.
- If migrating from another database, export the data to MySQL first or implement a DataIO adapter for that dbType and add a case to the factory.
- Check where dbType originates (config file/CLI arg) and correct it.
- Log/inspect the received dbType value to spot casing or null issues.
Example fix
// before
DataIO io = DataIOFactory.createDataIO("MySQL");
// after
DataIO io = DataIOFactory.createDataIO("mysql"); Defensive patterns
Strategy: validation
Validate before calling
String dbType = config.getDbType();
if (!"mysql".equals(dbType == null ? null : dbType.toLowerCase())) {
throw new IllegalArgumentException("data migrator supports only mysql, got: " + dbType);
}
DataIO io = DataIOFactory.createDataIO("mysql"); Try / catch
try {
DataIO io = DataIOFactory.createDataIO(dbType);
} catch (DataMigratorException e) {
if (e.getMessage().contains("not support for the moment")) {
// normalize dbType to "mysql" or implement a DataIO adapter
}
throw e;
} Prevention
- Pass the DataMigratorUtil.MYSQL constant instead of a raw string literal
- Normalize dbType from config/CLI to lowercase before calling the factory
- Document that the migrator is MySQL-only when extending tooling
When it happens
Trigger: Calling DataIOFactory.createDataIO with a dbType other than the supported "mysql" constant — e.g. "MySQL" with different case, "oracle", "postgresql", or null.
Common situations: Extending the migrator to another RDBMS; passing a dbType read from config with different casing; wiring the migrator against an Oracle/PostgreSQL source cluster.
Related errors
- {e.getMessage()}
- new & old table config is not equal!
- newSchema: is not exists!
- oldSchema: is not exists!
- please check file "dnindex.properties
AI-assisted analysis of MyCATApache/Mycat-Server@65f8d8beb7 (2026-09-11).
Data as JSON: /api/errors/905bb54250391bdc.
Report an issue: GitHub.
Appendix: source
Thrown at src/main/java/io/mycat/util/dataMigrator/DataIOFactory.java:16
package io.mycat.util.dataMigrator;
import io.mycat.util.dataMigrator.dataIOImpl.MysqlDataIO;
import io.mycat.util.exception.DataMigratorException;
public class DataIOFactory {
public static final String MYSQL = "mysql";
public static final String ORACLE = "oracle";
public static DataIO createDataIO(String dbType){
switch (dbType) {
case MYSQL:
return new MysqlDataIO();
default:
throw new DataMigratorException("dbType:"+dbType+" is not support for the moment!");
}
}
}
View on GitHub (pinned to 65f8d8beb7)