1. Goal: Change the value of character_set_server of mysql from latin1 to utf8 Temporary: SET character_set_server=utf8, one-time. Permanent: You need to change the configuration file, see step 2. 2. There is no configuration file in the support-files of mysql 5.7.21. Create a new my.cnf. You can create a text file and directly change the extension to cnf. It is best to open it with Xcode or subline. The content is as follows: [mysqld] character-set-server=utf8 [client] default-character-set=utf8 [mysql] default-character-set=utf8 3. Copy my.cnf to /private/etc/ cp /usr/local/mysql/support-files/my.cnf /private/etc/my.cnf Note: /etc is actually a stand-in for /private/etc and can be copied to either. 4. Restart the mysql server and enter mysql mysql>show variables like '%char%'; You can find that the encoding values are all changed to utf8. At this time, rebuild the database and table, and import the data to display Chinese normally. Summarize The above is the mysql5.7.21 utf8 encoding problem and solution in Mac environment introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: How to explain TypeScript generics in a simple way
>>: Steps for Vue3 to use mitt for component communication
1. Use xshell to connect to the virtual machine, ...
1. Use .gifs rather than .jpgs. GIFs are smaller ...
Download CentOS7 The image I downloaded is CentOS...
Quickstart Guide The Foreman installer is a colle...
Before understanding this problem, let's firs...
Log in docker login Complete the registration and...
Preface This article mainly introduces the releva...
Preface Use nginx for load balancing. As the fron...
The img tag in XHTML should be written like this:...
When the author was using MySQL to add a user, he...
Abstract: MySQL provides a variety of storage eng...
In my past work, the development server was gener...
Detailed explanation of the misplacement of the in...
Table of contents 01 Introduction to GTID 02 How ...
Development Background: Recently, I am working on...