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

  1. Pass exactly the MYSQL constant value ("mysql") as defined in DataMigratorUtil, matching case.
  2. 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.
  3. Check where dbType originates (config file/CLI arg) and correct it.
  4. 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

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


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)