Changing mySQL tables one by one to utf8... is there a single command to do it all at once?

Rosamunda - May 15, 2006 - 00:38

Hi there!
Because of a problem on my installation (I´ve transfered from one host to another my drupal webpage), all my tables have been imported in "latin1_swedish" instead of utf8_general.

I´ve checked that utf8 is as default in phpMyAdmin, and I´ve put the "collation" mode in utf8 clicking on "operations" on my drupal database, but each table remains as latin1_swedish.

So, I´m changing each table one by one, to utf8.

The big question is... is there a way to do it in one single, simple, nice, SQL command?

Please help me!! Chuif! I´m gonna spend the whole night changing those silly tables...

Thanks in advance to any help!

Rosamunda

anyone???

Rosamunda - May 15, 2006 - 03:18

please, anyone?

db dump > search/replace

trish t - May 15, 2006 - 05:06

You could just dump the db to a text file w/ inserts.

Make a back up copy and then, with a text editor, search and replace the latin1_swedish with utf8.
Then, drop the tables and import this edited file.

As silly as it sounds... I

Rosamunda - May 15, 2006 - 15:32

As silly as it sounds... I didn´t thought of that!
Thanks Trish!!

Rosamunda
Buenos Aires | Argentina
www.ligadelconsorcista.org

did it work

abqaria - August 2, 2006 - 20:49

did it work ?
if yes, what check boxes should i check when importing and exporting

thanks
Ahmed

solved it

abqaria - August 5, 2006 - 00:12

i managed to do it
i exported as text, replaced latin1 with utf8
then created a new database (to keep the old one as backup)
made a new connection
tried it
all fine
kept the new database
http://www.i-bloggers.com

 
 

Drupal is a registered trademark of Dries Buytaert.