This topic describes how to connect to a MySQL database for a full database compatibility assessment. The target mode is OceanBase MySQL compatibility mode.
Version support
Item |
Description |
|---|---|
| Source database version | Identified by the main MySQL version number (for example, 5.6, 5.7, 8.0). |
| Target database version | oceanbase-mysql. You can also specify 3.2.4, 4.2.1, 4.2.5, 4.3.5, 4.4.2, 4.5.0, 4.5.1, or 4.6.0 for --target-ob-version. |
Prerequisites
- Java Development Kit (JDK) 21 is installed, and
oceanbase-compat-engine.jaris obtained. For more information, see Install OMA. - The source database account has read permission on the object definitions of
information_schemaand the database to be assessed. - The server where the tool is running can access the source database on port
3306(or the actual port).
Procedure
Run the full database assessment. For a MySQL-compatible database, use
--databaseto specify the database name:java -jar oceanbase-compat-engine.jar compat \ --mode full --task-name mysql_db \ --type database --source-type mysql \ --host 10.10.10.2 --port 3306 --database appdb \ --username oms_user --password-env OMA_DB_PASSWORD \ --collect-mode full \ --target oceanbase-mysql --target-ob-version 4.4.2 \ --report-lang zh --output /data/oma/reports/mysql-db.htmlFor multi-database assessment, repeat the previous step by specifying multiple database names using
--schema. To exclude irrelevant databases, use--exclude-schema.For large databases, you can first collect only objects by setting
--collect-categories object, skipping system categories such as permissions and slow queries.Open the report path returned by the CLI to view the results.
Parameters
Parameter |
Description |
|---|---|
--database |
The name of the database to be assessed. This is the recommended entry for a MySQL-compatible database. |
--schema |
Equivalent to specifying the database name. You can pass it multiple times. |
--include-system |
Includes system databases such as information_schema. |
For descriptions of collection categories and object types, see Objects and metadata assessment.
The recent SQL information is read from performance_schema.events_statements_history_long, which is affected by its enablement status and the retention scope of historical records. When assessing business SQL, use Assess SQL statement compatibility instead.