_mysql of Mysql character coding in micro-credit development

Source: Internet
Author: User

Problem description: After getting code, you cannot request the micro-trust API data with Ajax. This is related to Ajax Cross-domain access to the user information to save to MySQL, found that the Chinese all become?? Garbled

By accessing the relevant data on the Internet, it is the character coding problem to judge the root cause of the problem.

Solution:

Modify configuration file/etc/mysql/my.conf

Under [MySQL]

Copy Code code as follows:

Default-character-set=utf8

Under [Mysqld]

Copy Code code as follows:

Character-set-server=utf8

Reboot fails

Copy Code code as follows:

Job failed to start
Mysql-t

Socket not connected

Later found that the original version is not the same modification method is not the same

What should be added under [Mysqld] is:

Copy Code code as follows:

Character-set-server=utf8
Collation-server=utf8_general_ci

That's it, okay?

Attached

View MySQL character encoding command

Copy Code code as follows:

Show VARIABLES like ' character_set_% ';

View the database character set

Status

View the character set of a table

Copy Code code as follows:

Show full cloumns from user;

The above content is this article about the micro-credit development in the MySQL character coding problem, I hope you like.

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.