Go Back   Forum Care Forums > Development Reference Area > MySQL Discussion

Reply
 
LinkBack Thread Tools Display Modes
latin1 to utf8 with phpMyAdmin
Old
  (#1)
buendias.web
Guest
 
Posts: n/a
Default latin1 to utf8 with phpMyAdmin - 06-04-2007, 07:58 AM

Hi,
I'm trying to convert a database with latin1 charset to utf8.
I have exported all data to a file using phpMyAdmin. Then, I've
created a new database using UTF8 charset and finally I have imported
all data using phpMyAdmin (removing all information about charset and
collation)

Tables and fields have UTF8 charset but data inside the tables are not
converted to UTF8 format.

Any idea?
Thanks

   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: latin1 to utf8 with phpMyAdmin
Old
  (#2)
Dikkie Dik
Guest
 
Posts: n/a
Default Re: latin1 to utf8 with phpMyAdmin - 06-04-2007, 07:58 AM

> I'm trying to convert a database with latin1 charset to utf8.
> I have exported all data to a file using phpMyAdmin. Then, I've
> created a new database using UTF8 charset and finally I have imported
> all data using phpMyAdmin (removing all information about charset and
> collation)
>
> Tables and fields have UTF8 charset but data inside the tables are not
> converted to UTF8 format.



If you still have the original database (or convert it back to latin1):

ALTER TABLE <table name> CONVERT TO utf8;

Just run this query on all the tables you want to convert. That should
be all.

Best regards
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: latin1 to utf8 with phpMyAdmin
Old
  (#3)
buendias.web
Guest
 
Posts: n/a
Default Re: latin1 to utf8 with phpMyAdmin - 06-04-2007, 07:58 AM

On 18 mayo, 12:27, Dikkie Dik <nos...@nospam.org> wrote:
> > I'm trying to convert a database with latin1 charset to utf8.
> > I have exported all data to a file using phpMyAdmin. Then, I've
> > created a new database using UTF8 charset and finally I have imported
> > all data using phpMyAdmin (removing all information about charset and
> > collation)

>
> > Tables and fields have UTF8 charset but data inside the tables are not
> > converted to UTF8 format.

>
> If you still have the original database (or convert it back to latin1):
>
> ALTER TABLE <table name> CONVERT TO utf8;
>
> Just run this query on all the tables you want to convert. That should
> be all.
>
> Best regards


Thanks. I'll try it next time.
This time I have exported database with phpMyAdmin and then I have run
a php script to convert sql file to utf8 (by the use of utf8_encode
function) Then, I have imported the sql file (what a mess!) and it
works.
Best regards.

   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top