MySQL not garbled thinking process

Source: Internet
Author: User

> Not garbled thinking process

(1) Linux

#修改linux系统字符集

# vi/etc/sysconfig/i18n

Lang= "ZH_CN. UTF-8 "

(2) Mysql

#临时设置字符集 (Method i)

mysql> set names UTF8;

#临时设置字符集 (Method Two)

# mysql-uroot-p--default-character-set=utf8

#永久设置字符集

# VI/ETC/MY.CNF

[Client] {Client, connection,results}

Default-character-set=utf8

[Mysqld] {Database,server}

Default-character-set=utf8

Mysql> Show variables like ' character_set% ';

+--------------------------+-------------------------------------------+

| variable_name | Value |

+--------------------------+-------------------------------------------+

| character_set_client | UTF8 |

| character_set_connection | UTF8 |

| character_set_database | UTF8 |

| Character_set_filesystem | binary |

| character_set_results | UTF8 |

| character_set_server | UTF8 |

| Character_set_system | UTF8 |

| Character_sets_dir | /application/mysql-5.5.32/share/charsets/|

+--------------------------+-------------------------------------------+

(3) Mysql Library table

#创建指定字符集数据库

mysql> CREATE Database oldboy_gbk DEFAULT CHARACTER SET UTF8 COLLATE utf8_general_ci;  



MySQL not garbled thinking process

Related Article

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.