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

How to deal with the problem of garbled codes in MySQL5

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

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the relevant knowledge of "how to deal with garbled code problems in MySQL5". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

1 set MyAdmin

Language:Chinese simplified (zh-utf-8)

MySQL character set: UTF-8 Unicode (utf8)

MySQL connection proofreading: gbk_chinese_ci

2 when creating a database

Set it to gbk_chinese_ci

3. Set up the table with SQL

ENGINE=MyISAM DEFAULT CHARSET=gbk

ENGINE=InnoDB DEFAULT CHARSET=gbk AUTO_INCREMENT=40

4 check table structure

The finishing property of varchar (100) is gbk_chinese_ci

Other types of finishing properties are empty

5 add to the code

$db- > query ("SET CHARACTER SET GBK"); required under Windows, not required under Windows

This is the equivalent of Connection Character Sets and Collations.

This is the end of the content of "how to deal with garbled code problems in MySQL5". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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