MySQL Chinese garbled--in MySQL in the Chinese into a question mark solution

Source: Internet
Author: User

Today, the server in the test, found in the database of Chinese all become question marks!

First think of this is the coding problem: So again set the database encoding to UTF8

However, the problem persists:

It was later discovered that the root of the problem should be:

Although the database encoding is UTF8, the tables and fields in the database are not UTF8

So to solve this problem, you have to set the database's Table and field encoding to UTF8:

Here's how it's set up:

Modify the database table encoding to UTF8:ALTER table ' table ' DEFAULT CHARACTER SET UTF8;

Modify the database field code to UTF8, of course you can change one field, but I'll tell you to modify the command at once: alter table ' tablename ' convert to character set UTF8;

MySQL Chinese garbled--in MySQL in the Chinese into a question mark solution

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.