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.