|
Today garbled on the test environment, but the same program in a formal environment (Ali cloud) no distortion. I checked the mysql coding found coded test environment is not all utf8. It needs to be mysql encoding are set to utf8.
Solutions are as follows:
1, the mysql installation directory my-default.ini copy, rename my.ini (because mysql5.6 no my.ini file)
2, add the following content my.ini, red box is a modified part:
[Mysql]
port = 3306
default-character-set = utf8
[Mysqld]
character-set-server = utf8
3, restart the mysql service, modify the coding end.
Coding look mysql modified: SHOW VARIABLES LIKE '% character%'. Should all utf8. Again insert data into the database, there is no distortion. |
|
|
|