If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Convert data charset

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-26-09, 17:09
bono56 bono56 is offline
Registered User
 
Join Date: May 2004
Posts: 133
Convert data charset

hi
i have a database with latin character set, with some data & i i want convert them to utf8.
is there any tool for convert current data to utf8?
Reply With Quote
  #2 (permalink)  
Old 01-29-09, 03:59
sassermann sassermann is offline
Registered User
 
Join Date: Aug 2002
Location: Germany
Posts: 17
Maybe
alter table.... convert to charset charset_name
... default charset charset_name
will help.

Andreas
Reply With Quote
  #3 (permalink)  
Old 01-31-09, 09:18
bono56 bono56 is offline
Registered User
 
Join Date: May 2004
Posts: 133
this statement only change table structure, not data in table
Reply With Quote
  #4 (permalink)  
Old 02-04-09, 03:12
sassermann sassermann is offline
Registered User
 
Join Date: Aug 2002
Location: Germany
Posts: 17
ok, 2nd try :-)
  • dump the table using mysqldump incl. drop table (--opt),
  • edit the create table statement in the dumpfile to utf-8 charset
  • reload the data

mysql shoud be aware of the difference between client and table charset and do the conversion.

another way could be to create new table 'table_uft8' and do a insert ... select with character conversion for each field

insert into table_uft8(collumn1, collumn2, ...) select convert (collumn1 using utf8), convert (collumn2 using utf8), ... from table_org;

and then swap tables by

alter table table_org rename to table_iso;
alter table talbe_utf8 to table_org;

Andreas
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On