The following are the referenced contents: Login:root shell> removepkg MySQL shell> Groupadd MySQL Shell> Cd/app shell> mkdir MySQL shell> chmod 744 MySQL shell> useradd-g mysql-s/bin/bash–p/app/mysql MySQL shell> chown-r mysql.mysql MySQL Download mysql4.x.x: Shell> Gunzip < mysql-version.tar.gz | TAR-XVF- Shell> CD Mysql-version shell> 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 the CPU type to optimize the compilation, you can make your MySQL performance better! There are many items to choose from: 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 ------------------------------------------ Wrong time Shell> Make Clean One more step back. --------------------------------------- shell> make Install shell> CP support-files/my-medium.cnf/etc/my.cnf Shell> Cd/app/mysql Shell> bin/mysql_install_db--user=root Shell> chown-r Root. shell> Chown-r mysql var Shell> chgrp-r MySQL. shell>./bin/mysqld_safe--user=root --DEFAULT-CHARACTER-SET=GBK & shell>./bin/mysqladmin-u root password ' new-password ' shell>./bin/mysql-u Root--default-character-set=gbk-p mysql> status ... Server CHARACTERSET:GBK Db CHARACTERSET:GBK Client CHARACTERSET:GBK Conn. CHARACTERSET:GBK .... See CharacterSet is all GBK even if successful. In the old database of the UTF8 character set, the script for creating the Chinese support table is as follows, with the character set description for the field: CREATE TABLE ' test '. ' CN ' ( ' Zh ' CHAR (CHARACTER SET gb2312 COLLATE gb2312_chinese_ci not NULL, ' Chinese ' INT (one) not NULL ) ENGINE = MYISAM; Note: CHARACTER SET write GB2312 and GBK can, GBK is better than gb2312. For a newly created database with a default character set declaration GBK, you do not have to create a table when each field is declared, so that looks simple and smooth, there is no special traces, it is recommended to use this method more. mysql> CREATE DATABASE DBCN DEFAULT CHARACTER SET GBK COLLATE gbk_chinese_ci; CREATE TABLE ' DBCN '. ' CN ' ( ' ZH ' CHAR (%) not NULL, ' Chinese ' INT (one) not NULL ) ENGINE = MYISAM; Mysql> INSERT INTO CN values ("Really?") ", 1); Note: If these scripts are not entered using the Bin/mysql command line, you can use MySQL query Browser, or program execution. ---------------------------------------------- shell> bin/mysql-u Root--default-character-set=gbk-p Mysql>use Test Mysql> SELECT * from CN; +--------+------+ | En | Chinese | +--------+------+ | Is it true? | 1 | +--------+------+ 1 row in Set (0.00 sec) --------------------------------------------- Finally modify the startup file/etc/rc.d/rc.mysqld, change the path/app/mysql/bin/mysqld_safe, change the path/app/mysql/var/web.pid/app/mysql/bin/mysqld_safe Add--user=root--DEFAULT-CHARACTER-SET=GBK to the back.
|