Compile and install mysql 5.1 using utf8 to solve the garbled Problem

Source: Internet
Author: User

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 !!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.