View and set the MySQL character set

Source: Internet
Author: User

Http://218.194.248.2/~wuxiaogang/cpcourse/database/mysql/charset.htm

1. Modify the MySQL my.cnf
# VI/ETC/MY.CNF

Add under [client]
Default-character-set=utf8

Add under [mysqld]
Default-character-set=utf8

If there is no my.cnf, find the location of the CNF for MySQL
# Find/-iname ' *.cnf '-print

Locate and then copy my-small.cnf, my-medium.cnf any one of the/ETC/MY.CNF
# CP/USR/SHARE/MYSQL/MY-MEDIUM.CNF/ETC/MY.CNF


2. Restart MySQL
#/etc/rc.d/init.d/mysql Restart
Or
# Service Mysqld Restart


3. View the character set
Mysql> Show variables like ' collation% ';
Mysql> Show variables like ' character% ';


View and set the MySQL character set

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.