In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how to avoid garbled MySQL character set". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to avoid garbled code in the MySQL character set.
The setting of the client character set varies according to different methods of the client:
1. Using the console connection, set it in the client entry in the my.ini file
two。 Using the ems connection, the character set configured by the ems connection is preferred, and the settings in the my.ini file are used by default
3. Jdbc connection. Specify in the connection string:
Jdbc:://192.168.3.99:3306/test?useUnicode=true&; characterEncoding=gbk
When writing, Mysq will convert the character set specified by the client into the database character set and store it in the data file, and when reading, it will convert the database character set into the character set specified by the client and show it to the client. The client character set is consistent with the database character set. The obvious advantage is to avoid the performance loss of conversion. In addition, if you take into account the future migration of the database, setting the database character set to the character set supported by most databases saves a lot of trouble.
Several character set-related commands:
1. View MySQL database server character set, database character set, and client character set
Show variables like char%
Character_set_client, client character set
Character_set_database, database character set
Character_set_server, server character set
two。 View the character set of the MySQL data Table (table)
Show table status from tablename like countries%
3. View the character set of the MySQL data column (column).
Show full columns from tablename
4. View the character sets supported by the currently installed MySQL.
Show char set
At this point, I believe that everyone on the "MySQL character set how to avoid garbled" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.