In addition to Weibo, there is also WeChat
Please pay attention

WeChat public account
Shulou
2025-10-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article is about how to solve the mysql5.7.21 utf8 coding problem in Mac environment. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
1. Goal: change the value of character_set_server for mysql from latin1 to utf8
Temporary: SET character_set_server=utf8 can be, 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 better to open it with Xcode or subline. The contents are 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, which can be copied to both.
4. Restart the mysql server and enter mysql
Mysql > show variables like'% char%'
You can see that the coding values are changed to utf8.
At this time, rebuild the database and build the table, and the imported data can be displayed in Chinese normally.
Thank you for reading! This is the end of this article on "how to solve the problem of mysql5.7.21 utf8 coding in Mac environment". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope





About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.