Modify MySQL Character Set

Source: Internet
Author: User

MySQL Character Set modification command

1. modify server level. temporary changes: mysql> set global character_set_server = utf8; B. permanent change: shell> VI/etc/My. CNF [mysqld] default-character-set = utf8

2. modify Database Level A. Temporary changes: mysql> set global character_set_database = utf8; B. permanent changes: changed the server level.

3. Modify the table-level mysql> alter table table_name default charset utf8; the change takes effect permanently.

4. example of modifying a column-level modification: mysql> alter table 'products' change 'products _ model' varchar (20) Character Set utf8 collate utf8_general_ci null default null; the change takes effect permanently. change the connection Character Set. temporary changes: mysql> set names utf8; B. permanent change: shell> VI/etc/My. CNF added in [client]: default-character-set = utf8

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.