The invention discloses a
database migration method, device and
system based on MyBatis and a storage medium, and relates to the technical field of
data migration. The method comprises the steps that an
XML configuration file of MyBatis is obtained and analyzed, and a first
SQL statement is obtained; obtaining a source
database grammar rule and a
target database grammar rule, and converting the first
SQL statement according to the source
database grammar rule to generate a second
SQL statement conforming to the
target database grammar rule; and performing optimization
processing on the second SQL statement based on the characteristics of the
target database to obtain an optimized SQL statement, and
rewriting the optimized SQL statement into the
XML configuration file of the MyBatis. According to the method disclosed by the embodiment of the invention, the migration
workload is reduced, the migration efficiency and accuracy are improved, the error risk in the migration process is reduced, and the portability of the application program and the compatibility of the database are enhanced; and the execution efficiency of the SQL statement is improved.