Option configuration
Profile path: /full/path/mysql/bin/my.cnf
(default is /etc/my.cnf
)
[Client]
Default-character-set=utf8
[MySQL]
default-character-set=utf8
[mysqld]
init_connect= ' Set collation_connection = Utf8_unicode_ci '
init_connect= ' SET NAMES UTF8 '
Character-set-server=utf8
Collation-server=utf8_unicode_ci
Skip-character-set-client-handshake
Attention
Using the Default-character-set setting in mysqld, the MySQL boot will not start without an error.
Description
About the UTF8 character set, our domestic default choice: utf8_general_ci
instead utf8_unicode_ci
of,
The difference is in the character contrast
Please see the example of MySQL above:
For the general, ß= S is true.
But for Unicode, the ß= SS is true,
In fact, their differences are mainly in German and French, so for us Chinese, generally use general, because more faster
If you have higher requirements for German and French comparisons, use Unicode, which is more accurate than general (in terms of German and French standards, more accurate in comparison or sorting).
Look at this document: http://dev.mysql.com/doc/refman/5.7/en/charset-unicode-sets.html
There are also utf8_bin_ci is more commonly used oh, in the character contrast, Unicode and general are not case sensitive, so if the request is sensitive to case, use bin
Summarize
The above is the entire content of this article, I hope that the study or work to bring some help, if you have questions you can message exchange.