472,141 Members | 1,563 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,141 software developers and data experts.

latin1 to utf8

I am using mysql and have some data in my application in the latin1
charset. I have a necessity to support the utf 8 charset. Now I want to
migrate the data between these two charset.

The normal way I do migration is as follows:

Taking a dump of the data with the currently running mysql
converting the necessary parameters in the mysql settings and starting
the mysql with utf8 support
droping the database.
replacing latin1 to utf 8 in the dump.sql file
loading the data back on to the mysql db.
I am fearing of a data inconsistency in the way I do....

Is the above way fool proof and will not cause any data loss or there
is a easy way to convert things to utf8 support using mysql commands
without using a dump.

Appreciate a quick response.

Thanks ,
Ranjith

May 26 '06 #1
2 3046
ra**********@gmail.com wrote:
I am using mysql and have some data in my application in the latin1
charset. I have a necessity to support the utf 8 charset. Now I want to
migrate the data between these two charset.


I don't know any answers to your questions, but here is something to
read about:
http://dev.mysql.com/doc/refman/5.0/en/charset.html
May 26 '06 #2
ALTER TABLE tablename charset='utf8';

Doesn't that work? Keep in mind that it's basically going to do what
you are doing - create a new table (with utf8 charset), copy the data
over, and rename the table.

If you need MySQL (or PostgreSQL) training, we offer a wide range of
both. (http://www.otg-nc.com)

--
Chander Ganesan
Open Technology Group, Inc.
One Copley Parkway, Suite 210
Morrisville, NC 27560
Phone: 877-258-8987/919-463-0999

ra**********@gmail.com wrote:
I am using mysql and have some data in my application in the latin1
charset. I have a necessity to support the utf 8 charset. Now I want to
migrate the data between these two charset.

The normal way I do migration is as follows:

Taking a dump of the data with the currently running mysql
converting the necessary parameters in the mysql settings and starting
the mysql with utf8 support
droping the database.
replacing latin1 to utf 8 in the dump.sql file
loading the data back on to the mysql db.
I am fearing of a data inconsistency in the way I do....

Is the above way fool proof and will not cause any data loss or there
is a easy way to convert things to utf8 support using mysql commands
without using a dump.

Appreciate a quick response.

Thanks ,
Ranjith


Jun 5 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.