In windows mysql 5.7 to modify the encoding to UTF-8 method steps, mysqlutf-8
Preface
When I first started learning MySQL, I downloaded the latest version 5.7.14 from the official website. When I entered the Chinese language using cmd, an error was reported. So I started to modify the default mysql encoding (in windows). Let's take a look at the detailed modification methods.
The method is as follows:
First passShow variables like 'character _ set _ % ';
View mysql character sets
The default encoding is latin1.
Close the database.
Find the my. ini file in the mysql installation directory.
Add
[Client] default-character-set = utf8
In[Mysqld]
Add
Character-set-server = utf8
Restart mysql
You can change the default encoding of the mysql database to UTF-8.
Many resources on the Internet are[Mysqld]
Add
Default-character-set = utf8
If this is done, mysql 5.7 cannot be enabled.
So you need to change
Character-set-server = utf8
Note:After modification, all data in the database must be deleted before use.
Summary
The above is all the content of this article. I hope the content of this article will help you in your study or work. If you have any questions, please leave a message, thank you for your support.