XOOPS (mysql) GB2312 Code Conversion to UTF-8 Specific Steps Method, by Emerald Green College - Green Institute.
/ - * ------------------------------------------------------------------------------------------------------------------------------------- ------------------------------- * - /
I. Find *: / windows / my.ini
------------------------------------------ Note: * Represents the system Drive.
Change the following content (flexible transformation according to your own settings): ------------------------------------- --------
# ------------------------------------------ [WinMysqladmin] Server = C: /mysql/bin/mysqld-nt.exe [mysqld] basedir = C: / mysql / datadir = C: / mysql / data key_buffer = 32M max_allowed_packet = 64M table_cache = 64 sort_buffer_size = 512K net_buffer_length = 8K read_buffer_size = 256K read_rnd_buffer_size = 512K myisam_sort_buffer_size = 32M set-variable = max_connections = 1000 # -------------------------------------------------------------------------------------------------------------------- -
Mainly to increase the value of this max_allowed_packet = 64m. (How much is added according to the size of your own library)
Then restart MySQL (can restart MySQL, do not need to restart the operating system).
# ---------------------------------------- Net Stop MySQL (Stop MySQL Service NET START MYSQL (Starting MySQL Service) # -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -
------------------------------------------ Note: View is effective Use this command to view: c: / mysql / bin> mysqld --help ------------------------------------------------------------------------------------------------------------------------------------------------------ ---------
# ----------------------------------------- 显示 m_allowed_packet 67107840 max_binlog_cache_size 4294967295 Max_BINLOG_SIZE 1073741824 # --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/ - * ------------------------------------------------------------------------------------------------------------------------------------- ------------------------------- * - /
II. Enter the mysql installation directory in the command line C: / mysql / bin /
Run the following parameters export data. MySQLDUMP --OPT -U root -p XoopsFinal_90> XOOOPSFinal_90.sql
------------------------------------------ Note: root is the username, XOOOPSFINAL_90 is the database in MySQL, XOOPSFinal_90.sql is the * .sql file after export. ------------------------------- ----------------
Example: # ---------------------------------------- C: / mysql / BIN> mysqldump --opt -u root -p xoopsfinal_90> XOOOPSFINAL_90.SQL ENTER password: ************** C: / mysql / bin> # -------- ----------------------------------
------------------------------------------- Note: ***** ********** is the password of MySQL owner. -------------------------------- -----------
If you are wrong, there is more XOOOPFINAL_90.SQL in a C: / MySQL / BIN / directory.
/ - * ------------------------------------------------------------------------------------------------------------------------------------- ------------------------------- * - /
3. Open XoopsFinal_90.sql file with EditPlus, then save it as a UTF-8 encoding.
------------------------------------------ Note: Or others can save UTF-8 encoded software can be used --------------------------------------- -
/ - * ------------------------------------------------------------------------------------------------------------------------------------- ------------------------------- * - /
IV. Run the following command Import data mysql -u root -p Xoopsfinal_90 Example: # ----------------------------------------- mysql -u root - P xoopsfinal_90 ------------------------------------------ Note: If the 1042 error occurs It is recommended to delete the database in the * .sql file, then continue to import. There are two error when I import, so I have to give up the two databases. -------------------------------- --------------------------- / - * ------------------------------------------------------------------------------------------------------------------------------------- ------------------------------- * - / V. Modify the file code to UTF-8, UNIFier software can convert file format to UTF-8 & UTF-16, but unregistered versions can only modify files less than 4K. Even method: # ---------------------------------------- Run Editplus, # ---------------------------------------- File - Open - Converter - UTF -8 #------------------------------------------ ------------------------------------------ Note: Meaning is UTF- 8 Encoding open files. ------------------------------------------- Then open all the files that can be seen. (If you contain Chinese, you can only open in the default format, then save it to UTF-8 encoding.) Then save all, then turn it off, you may have a directory to open and close. But considering that it is not a lot of directories, so I use this stupid method. If it is Unix has a more convenient method, but I am Windows, here is not detailed ./-*---------- -------------------------------------------------- -------------------- * - / Additional: You can save the full & turn off for EditPlus to save the shortcuts. Steps: Tools - Preferences - Tools - Keyboard - File defines your shortcut. / - * ------------------------------------------------------------------------------------------------------------------------------------- ------------------------------- * - / / ************************************************** *************** / * * Author: Emerald