Solve mac mysql Chinese Character garbled Problem

Source: Internet
Author: User

Mac mysql Chinese CHARACTER garbled problem solution it is best to specify the CHARACTER encoding when creating a database or table: create database db_name default character set utf8 default collate utf8_general_ci; // create table order_list (id int unsigned not null AUTO_INCREMENT, O_name VARCHAR (40) not null, O_desc VARCHAR (600) DEFAULT '', O_category VARCHAR (50) not null, o_style VARCHAR (20) DEFAULT '', O_state enum ('1', '0') not null, O_unitprice double not null, O_icon VARCHAR (20) not Null, primary key (id) ENGINE = MYISAM AUTO_INCREMENT = 1 default characterset = utf8; // create the table insert into order_list comment '); /If no encoding is specified in the preceding two steps, a second element error is prompted during step 3 insertion because latin encoding is not specified by default, chinese characters cannot be inserted. In addition, Chinese characters output at the Customer Service end must be supported. For example, if you bind a Chinese character with php, You need to modify/usr/local/mysql/my. the cnf modification content is [client] default-character-set = utf8 and character-set-server = utf8. Now you can output Chinese characters.
 

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.