14.13. MySQL Localisation and International Usage

WWW: MySQL Localisation and International Usage

動態能從 my.cnf 調整的部份並沒有 big5.conf:

% ls /usr/local/share/mysql/charsets
Index        danish.conf   greek.conf      koi8_ukr.conf  usa7.conf
README       dec8.conf     hebrew.conf     latin1.conf    win1250.conf
cp1251.conf  dos.conf      hp8.conf        latin2.conf    win1251.conf
cp1257.conf  estonia.conf  hungarian.conf  latin5.conf    win1251ukr.conf
croat.conf   german1.conf  koi8_ru.conf    swe7.conf

靜態要在 compile 階段完成的部份:

% ls mysql-3.23.55/strings/ctype*.c
mysql-3.23.55/strings/ctype-big5.c    mysql-3.23.55/strings/ctype-sjis.c
mysql-3.23.55/strings/ctype-czech.c   mysql-3.23.55/strings/ctype-tis620.c
mysql-3.23.55/strings/ctype-euc_kr.c  mysql-3.23.55/strings/ctype-ujis.c
mysql-3.23.55/strings/ctype-gb2312.c  mysql-3.23.55/strings/ctype.c
mysql-3.23.55/strings/ctype-gbk.c

也就是說 multibyte support 必須要 compile 時就給他下好這個參數, 是否能直接設定 my.cnf 達到 --with-charset=big5 的效果還不確定。

檢驗方式,進入 mysql 後打:

mysql> show variables like 'character_sets';
mysql> show variables like 'character_set';

那 character set 影響那些呢?就我所知的有 ORDER BY 和 GROUP BY 的順序,那特殊中文字 insert 進資料的問題還是在嗎?

Note: 另一常見的問題是,MySQL 無法輸入中文資料庫名稱、中文表格名稱、 中文欄位名稱?其實是可以的,只要用 ` 將中文字包含在內就可以,像是 CREATE DATABASE `哈囉`;

WWW: http://www.mysql.com/