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?
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 JohannssonDatabase Administrator / Software EngineerCommented:

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.
Here is an example
LOAD DATA LOCAL INFILE '/path/to/file.csv'
  INTO TABLE imported_table
  CHARACTER SET 'latin1'

Open in new window

    Tomas Helgi

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.
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
Poster never provided feedback + has stopped posting.

Accepting both good approaches to resolving this problem.
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

From novice to tech pro — start learning today.