Solve the problem of garbled data in MySQL database migration

Solve the problem of garbled data in MySQL database migration

Under the instructions of my leader, I took over a Java project and needed to refactor it. At the same time, the overall construction of the project had to meet the requirements of information innovation.
Then first of all, two points must be met:
1. Use the domestic database Dameng 8 to replace the MySQL database
2. Use Kingdee middleware to replace tomcat for container deployment

With unremitting efforts, I have completed the local construction and installation of the DM8 database, and also completed the demo verification work of changing the database source in the code framework and replacing the DM8 database.

driverClassName: dm.jdbc.driver.DmDriver
    url: jdbc:dm://10.0.3.132:5236/XC-SERVICE?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8
    Username: XC-SERVICE
    password: 123456789

Now the code works fine. There are no other problems except that some SQL scripts need to be standardized.

Now the most important thing is to migrate the data.

That is to migrate the mysql library to dm8.
Migration method: use DAMO's own database migration tool

insert image description here

DAMO comes with a database migration tool

Data table structure and data migration effects

insert image description here

After the migration is complete, you will be surprised to find that there is no problem with the data table structure, but the Chinese data is all garbled.

I tried many methods and searched on Baidu several times, but couldn't find a solution. Later, I had no choice but to go to the DAMO forum to look for a solution.

Finally, I found a magical solution to the problem of garbled characters after data migration.

insert image description here

When using the data migration tool to configure the data source, select Specify Driver.

insert image description here

Specify the URL address:

jdbc:mysql://10.0.3.131:3306/sys-service?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai

At the same time, specify the driver that Maven downloads to the local computer.

OK, now we can migrate the data

After the migration is complete, you will magically find that the data is normal and not garbled! ! ! !

insert image description here

postscript

As for the domestically produced database, DAMO is still a good product, but there is too little information on the Internet, and you may not be able to find it on Baidu. I write this content in the hope that it will be helpful to you.

This is the end of this article about solving the problem of garbled data in MySQL database data migration. For more relevant content about garbled data in MySQL migration, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How does MySQL implement ACID transactions?
  • Detailed explanation of the implementation principle of ACID transaction in Mysql
  • MySQL's surprising implicit conversion
  • MySQL not null constraint case explanation
  • Solution to MySQL connection exception and error 10061
  • MySQL transaction control flow and ACID characteristics

<<:  Windows Service 2016 Datacenter\Stand\Embedded Activation Method (2021)

>>:  CSS Paint API: A CSS-like Drawing Board

Recommend

Functions in TypeScript

Table of contents 1. Function definition 1.1 Func...

Definition and function of zoom:1 attribute in CSS

Today I was asked what the zoom attribute in CSS ...

The role of MySQL 8's new feature window functions

New features in MySQL 8.0 include: Full out-of-th...

MySQL query tree structure method

Table of contents MySQL query tree structure 1. A...

Detailed example of inserting custom HTML records in Quill editor

It is already 2020. Hungry humans are no longer s...

Detailed explanation of MySql slow query analysis and opening slow query log

I have also been researching MySQL performance op...

20 CSS coding tips to make you more efficient (sorted)

In this article, we would like to share with you ...

Detailed explanation of the buffer pool in MySQL

Everyone knows that data in MySQL needs to be wri...

VMware Workstation Pro installs Win10 pure version operating system

This article describes the steps to install the p...

How to batch generate MySQL non-duplicate mobile phone number table example code

Preface In many MySQL test scenarios, some test d...

How to view the database installation path in MySQL

We can view the installation path of mysql throug...

Analysis of the usage of Xmeter API interface testing tool

XMeter API provides a one-stop online interface t...

Analyze how to automatically generate Vue component documentation

Table of contents 1. Current situation 2. Communi...

React's transition from Class to Hooks

Table of contents ReactHooks Preface WhyHooks? Fo...