Multi language support while migrating from db2 to mysql

I have a database in db2 that needs to be migrated to mysql. I ma expoting data from db2 to csv and then csv to msql. the data is in multiple langugaes like Chinese, French, Latin, Hebrew, etc. Due to character set issues, the data is converted into symbols. How shall I ensure that the import is done correctly without any changes in the data
Himakshi MangalAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tomas Helgi JohannssonCommented:
Hi!

Is each language in separate tables in DB2 or is the data mixed in the tables ?
If the former then you have each table exported into individual files each with their language.
Then you could use the LOAD command in the MySQL with the correct CHARACTER SET that belongs to the file/data.
Also make sure that the tables in MySQL are properly configured to the same CHARACTER SET that belongs to the data as well.
https://dev.mysql.com/doc/refman/5.7/en/load-data.html
https://dev.mysql.com/doc/refman/5.7/en/charset-table.html
Here is an example
LOAD DATA LOCAL INFILE '/path/to/file.csv'
  INTO TABLE imported_table
  CHARACTER SET 'latin1'
  COLUMNS TERMINATED BY ','
  OPTIONALLY ENCLOSED BY '"'
  ESCAPED BY '"'
  LINES TERMINATED BY '\r\n'
  IGNORE 1 LINES;

Open in new window


https://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0008303.html

Regards,
    Tomas Helgi
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
Tomas asked my first question too.

If each language lives in a separate table, then you'd load each table into MySQL (or far better MariaDB) using fixed/forced/explicit charsets.

If all languages live in the same table, whew... This will require a very different approach, which depends on how data will be searched for after it's loaded into MySQL.

Seriously, before you do this, best look at MariaDB, as there are many language processing fixes in MariaDB.

Many Distros (Debian/Ubuntu/etc) have set MariaDB to be installed anytime a MySQL package target is specified now.

If your language data is commingled in one table, this might work for you...

pv your.sql | mysql --defaults-extra-file=/etc/mysql/debian.cnf --default-character-set=utf8 your-empty-database

Open in new window


Again, this all depends on incoming data format (how your.sql file is dumped) + how data will be used in MySQL.

If your data is commingled, might be best to open a Gig + look for someone who works with multi-lingual + commingled data on a daily basis.
0
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
Poster never provided feedback + has stopped posting.

Accepting both good approaches to resolving this problem.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.