1. yum install-y gcc-c ++ ncurses-devel bison
2. shell & gt; groupadd mysql shell & gt; useradd-g mysql shell & gt; gunzip <mysql-5.1.55.tar.gz | tar-xvf-shell> cd mysql-5.1.55 shell & gt ;. /configure -- prefix =/usr/local/mysql -- with-charset = utf8 -- with-extra-charsets = all -- enable-validator -- enable-thread-safe-client --- big-tables -- with-readline -- with-plugins = innodb_pluginshell & gt; make shell> make install shell> cp support-files/my-medium.cnf/etc/my. cnf shell & gt; cd/usr/local/mysql shell & gt; bin/mysql_install_db -- user = mysql shell & gt; chown-R root. shell & gt; chown-R mysql var shell & gt; chgrp-R mysql. shell & gt; bin/mysqld_safe -- user = mysql & 4. after the installation is complete, it will still be + ---------------------- + -------------------------------------- +
| Variable_name | Value |
+ -------------------------- + ---------------------------------------- +
| Auto_increment_offset | 1 |
| Character_set_client | latin1 |
| Character_set_connection | latin1 |
| Character_set_database | utf8 |
| Character_set_filesystem | binary |
| Character_set_results | latin1 |
| Character_set_server | utf8 |
| Character_set_system | utf8 |
| Character_sets_dir |/usr/local/mysql/share/mysql/charsets/|
+ -------------------------- + ------------------------------------------ + Finally in my. in cnf, set [mysqld] and [client]: default-character-set = utf8. but the php is still garbled, in order not to change the program. finally, I found the method to add the original address -- [mysqld ].
Default-character-set = utf8
Init_connect = SET collation_connection = utf8_general_ci
Init_connect = set names utf8
Character-set-server = utf8
Collation-server = utf8_general_ci
Skip-character-set-client-handshake !!