I installed the MySQL version is 5.7.20, installed MySQL will have to modify the character set, so according to most of the online tutorial said to the installation directory to find a My-default.ini file, and then renamed to My.ini, and then into the modified character set, so I opened the MySQL installation directory Under stunned, inside incredibly didn't have this file.
So spent nearly an afternoon to find a solution to the method, Kung Fu, finally found a solution to the method, specifically as follows:
1, mysql5.7.20 My.ini file is not in the installation directory, if you are the default installation of MySQL, then its My.ini file in the hidden folder C:\ProgramData\MySQL\MySQL Server 5.7
2, to modify the My.ini file, please back up a copy before the change.
Make configuration changes under the My.ini file:
[Client]
Default-character-set = UTF8
[MySQL]
Default-character-set = UTF8
[Mysqld]
Character-set-client-handshake = FALSE
Character-set-server = UTF8
Collation-server = Utf8_unicode_ci
init_connect= ' SET NAMES UTF8 '
3. After modifying the My.ini file, save and restart the MySQL service. Computer-right--management--services, find mysql57, right-click on it to stop, and then start
4, open the terminal, login MySQL and then check the character set:show variables like ' character% '; the character set is changed successfully at this time.
Mysql5.7 Modifying character sets