從 MySQL4(big5-encoding) 升級至MySQL5(utf-8 encoding) 我已經做過很多次了,
真的有很多小地方要注意, 所以以下步驟僅供參考(以coppermine為例)


1. dump資料出來
mysqldump -d --default-character-set=big5 coppermine -u root -pooxx > ~/schema.sql
mysqldump -c -l -q -t --default-character-set=big5 --hex-blob -uroot -pooxx coppermine > ~/big5.sql

2.
移除mysqld, 開始裝mysql5
cd /var/db/pkg/ && pkg_delete -f mysql-*-4*
記住有哪些等會要重編的
/etc/make.conf 把SKIP_INSTALL_DB=yes先mark起來
cd /usr/ports/databases/mysql50-server/ && make install clean
重編該重編的packages(e.x. php5-mysql)


3.
mysql -uroot --default-character-set=big5 coppermine < schema.sql
mysql -uroot --default-character-set=big5 coppermine < big5.sql

4.
/etc/make.conf 把SKIP_INSTALL_DB=yes加回來


以上是最理想的狀況, 通常可能會有一些小狀況 :p
請自行處理掉吧 哈哈



arrow
arrow
    全站熱搜

    Izero 發表在 痞客邦 留言(0) 人氣()