MySQL Character Set settings

Source: Internet
Author: User

/*************************************************************************** * MySQL Character Set setting * Description: * Database This block is often due to incompatible character sets resulting in data communication anomalies, so this side of the * MySQL character set to Utf-8, this is more general. * 2016-9-24 Shenzhen Nanshan Ping Shan village Zengjianfeng ******************************************************* *******************/First, reference documents:1. (original) Linux under MySQL5.5/5. 6 modified Character set encoding for UTF8 (completely solve Chinese garbled problem) http://www.ha97.com/5359.htmlIi. Solutions: Cat/etc/my.cnf ... [Client] ...default-character-Set=UTF8 ... [MySQL] ...default-character-Set=UTF8 ... [Mysqld] ... collation-server =utf8_unicode_ci Init-connect=' SET NAMES utf8′character-Set-server =UTF8 ... Third, view results: [[email protected]~]# Mysql-u Root-P Enter Password:welcome to the MySQL Monitor. Commands End With;    or \g. Your MySQL Connection ID is 1Server Version:5.1. the-Log Source Distribution Copyright (c) -, -, Oracle and/or its affiliates.        All rights reserved. Oracle isA registered trademark of Oracle Corporation and/or its affiliates.        Other names trademarks of their respective owners. Type'Help ;'Or'\h'  forHelp. Type'\c'To clear the current input statement. MySQL> SHOW VARIABLES like'character%'; +--------------------------+----------------------------+    | 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 |    /usr/share/mysql/charsets/| +--------------------------+----------------------------+8Rowsinch Set(0.00sec) MySQL>quit Bye [[email protected]~]#

MySQL Character Set settings

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.