Go Back   Pligg CMS Forum > Other > Suggestions

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-09-2006, 05:08 AM
savant's Avatar
Constant Pligger
 
Join Date: Apr 2006
Location: UK
Posts: 1,218
Thanks: 64
Thanked 207 Times in 148 Posts
Digg’s MySQL Internationalisation Gotcha

Digg’s MySQL Internationalisation Gotcha

Quote:


Recently at Digg we started doing internationalisation efforts. Our database was storing data in latin1 character set although PHP was using the UTF8 character set. That limited our language support, so we decided to convert the DB to UTF8.

MySQL has a “charset=” option at the end of the CREATE TABLE, so we ran through all our tables doing “alter table charset=utf8.” This worked, and we were pleased as punch.

But then examining a particular table, I noticed:

CREATE TABLE (
id integer not null default 0,
name varchar(32) character set latin1 default NULL,

) charset=utf8;

Every column that actually stored text specified the old “latin1″ encoding. It turns out in MySQL, when it comes time to change your character set, there’s a special ALTER command that will also change each of the columns:

alter table convert to character set utf8;

This changes all the text columns to the new character set as well.

Digg on,

timeless
Maybe some one could try this and see what effects it has
__________________
Anatomy of the Pligg template Help needed
Reply With Quote
The Following 2 Users Say Thank You to savant For This Useful Post:
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
Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL charset and MySQL connection collation pligger2 Installation and Upgrade Help 7 11-04-2008 08:33 PM
mysql has gone away error php warning argh2xxx Bug Report 5 08-13-2008 02:45 AM
Too many connections and mysql down xenfra Bug Report 2 05-30-2008 12:03 PM
can't connect locally to MySQL Server fleagle Installation and Upgrade Help 13 01-31-2008 05:27 PM
Pligg and MySQL 3.23 TobiParrot Installation and Upgrade Help 2 12-05-2007 05:20 PM


Search Engine Friendly URLs by vBSEO 3.2.0