系統內建的MySQL預設字元集不是gbk,因此給資料庫的推廣應用以及中文程式的開發帶來極大的不便,在沒完沒了的GBK和UTF8的轉換過程中消耗了我們無數的精力以及系統的資源。
先將讓slack支援中文,然後重新編譯MySQL,原來系統MySQL的要先卸載:
login:rootshell> removepkg mysqlshell> groupadd mysqlshell> cd /appshell> mkdir mysqlshell> chmod 744 mysqlshell> useradd -G mysql -s /bin/bash –p /app/mysql mysqlshell> chown -R mysql.mysql mysql |
再下載MySQL4.x.x:
shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -shell> cd mysql-VERSIONshell> CFLAGS="-O3 -mcpu=pentium3" \CXX=gcc \XXFLAGS="-O3 -mcpu=pentium3 -felide-constructors" \./configure --prefix=/app/mysql \--with--charset=gbk \--with-extra-charsets="gbk gb2312 big5 utf8"\--with-unix-socket-path=/etc/mysql.sock \--enable-local-infile \--enable-thread-safe-client \--enable-assembler \--with-client-ldflags=-all-static \--with-mysqld-ldflags=-all-static |
//-mcpu 根據CPU類型最佳化編譯,可以讓你的MySQL表現更好。可選項目很多:i386, i486, i586, i686, pentium, pentium-mmx, pentiumpro, pentium2, pentium3, pentium4, k6, k6-2, k6-3, athlon, athlon-tbird, athlon-4, athlon-xp,athlon-mp,winchip-c6, winchip2 , c3。執行:shell> make。錯誤時候執行:shell> make clean。