Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The solution of Chinese garbled code in MySQL database.

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Is it easy to input Chinese in the database to appear garbled code? (Source of garbled code problem: see https://blog.51cto.com/12042068/2115021)

Solution: 1. Specify default code utf8 when building table library.

CREATE TABLE table_name (column_name column_type) default charset=utf8; Specify character set explicitly)

2. Through the comparison of 2 parameters to illustrate the solution of garbled characters on different clients:

Let's start with two parameters: character_set_client and character_set_results

The following is a comparison of encoding formats under MySQL character window and DBeaver respectively:

v s

Meaning of parameters here:

Here are two modified screenshots: the effect is clear at a glance

The garbled code problem, basically so find the source. One by one. Come on.

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report