尚未登入 (登入)

類別

近來的標籤 觀看所有標籤


Powered by A Small Orange Firefox 2
Look better in 1024*768 and above.

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

本論壇所有文章,除特別聲明(如轉載文章)外,版權均為文章作者所有,如沒取得作者同意,切勿轉載。
本論壇所有內容,除特別聲明外,版權皆為 Libracafe.com 所有。
Copyright © 2006~2007 Libracafe.com. All rights reserved.

歡迎光臨!
論壇完整文章列表及大部份功能,必須登入後才能觀看及使用。
想發表意見嗎? 如果你已有帳號,請點這裡登入. 沒有的話,可以立刻在這申請.
亦歡迎使用留言版留下你的意見.
    •  
      CommentAuthor盧雲
    • CommentTimeJan 14th 2007, 7:17:30 am 修改過
     # 1

    @Also posted at: Lussumo Community - Change database to UTF8 from latin1. Yes, i am the author.

    I just changed my exist Chinese forum's database to utf-8 form latin1 with phpMyAdmin, and I want to help someone has this necessity also.

    Why change it?
    My website hosted in Dreamhost, and phpMyAdmin's charset is UTF-8, but my database is latin1, I can't view *any* correct Chinese characters on my phpMyAdmin page. Otherwise, it works fine. So, make sure you really need to change, and it has some risks.

    How to?
    1. Setup Apache, MySQL, PHP and phpMyAdmin on home computer. (You would like to use AppServ.)
    2. If home computer is using windows, you have to add
    set-variable = lower_case_table_names=0

    in the my.ini (MySQL configuration file) below
    [mysqld]

    to make table names don't change to lowcase. (http://www.phpmyadmin.net/documentation/#faq1_23)
    Restart home computer's MySql Service.

    3. Export forum's data with phpMyAdmin on forum's server. (and backup these file)
    4. Create new database with any name (eg. utf8_temp) on home computer, use utf8_general_ci for the collation.
    You would get some information like "CREATE DATABASE `utf8_temp` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;" form phpMyAdmin.
    5. Open "utf8_temp"(or other name you choice), click the import page, choose "utf8" in the character set and import forum's data.
    6. Now you can browse some tables of the database, it'll be same as the server.

    7. Change home computer's phpMyAdmin source "phpMyAdmin\libraries\select_lang.lib.php", below
    // MySQL charsets map

    change:
    'utf-8' => 'utf8',

    to
    'utf-8' => 'latin1',

    Save file.
    8. Refresh browser (also change view encoding to utf8), if the LUM_Comment table's(or other table that has non-latin character) character is correct, it almost success.
    9. Export whole datebase with none compression and save to a sql file.
    10. Open the new .sql file with your favorite editor, change all "latin1" to "utf8".
    11. Similar step 7, change
    'utf-8' => 'latin1',

    back to
    'utf-8' => 'utf8',

    12. Do again step 4 and step 5, *but* import the new .sql file you just modify, than make sure database's character is correct.

    13. If anythings work fine, you can import the new .sql file to your forum server's new database. (same as step 12 but in forum's server)
    14. Take a look with http://lussumo.com/vanilladev/discussion/126/mysql-utf8-and-cyrillic-characters-i-sh-displays-like-/#Item_1 (thanks 130) and make necessity change. (I only change Framework.Class.MySQL.php.)
    15. Modify vanilla db's setting file(eg: forum/conf/database.php), change "$Configuration['DATABASE_NAME']"'s value to point to your new utf8 database.
    16. Done. Now you can test your forum with the new utf8 database.

    Other references: 1.0.1 issues(thanks Max_B give me some information)