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 importing phpmyadmin garbled code

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article mainly introduces the introduction of phpmyadmin garbled solutions, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian with you to understand.

When using PHPmyadmin to import and export mysql database, there is a problem of garbled code in Chinese.

The following describes the solution when you encounter Chinese garbled code.

The problem lies in the coding.

The character set codes used by Chinese websites are generally gb2312,gbk,utf8.

Because the default character set of phpmyadmin is latin1_swedish_ci.

It is different from the commonly used gb2312,gbk,utf8, so if you do not modify the character set, there will be garbled.

Therefore, when exporting the database, you should pay attention to the coding problem.

Because the frequently used character set is gbk_chinese_ci, so take gbk_chinese_ci as an example to illustrate how to deal with the problem of Chinese garbled.

First of all, when exporting the data, check to see if the Chinese in the records in the data table can be displayed properly. With such a question mark, you need to reset the language to the database format of the encoding you use, such as:

The database is encoded as gbk_chinese_ci and the database engine is MyISAM, so the Language (language) of phpMyAdmin must be set to Chinese simplified (zh-utf-8) instead of Chinese simplified (zh-gb2312-utf-8).

Similarly, if your data encoding is gb2312_chinese_ci, then Language must be set to Chinese simplified (zh-gb2312-utf-8), not Chinese simplified (zh-utf-8).

Only if we choose the right language, we will not have Chinese garbled when we export sql.

In order to check whether the exported sql file is correct, you can directly open the .sql file with notepad and check the Chinese to see if it is garbled. If the display is normal, it means that it has been exported correctly.

When migrating a website or re-importing a sql file, the general MySQL character set: UTF-8 Unicode (utf8) does not need to be modified. When importing the exported sql script above, select utf8 (default) for the character set of the file.

Note: before entering any operation, such as insert, query, etc., you must specify the character set by adding a sentence to the database connection file: set names' gbk'; there will be no garbled code when the web page is displayed. In short, you can specify whatever code you use.

At this point, the problem of Chinese garbled code in using PHPmyadmin has been solved.

Thank you for reading this article carefully. I hope the article "the solution of importing phpmyadmin garbled code" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you 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.

Share To

Database

Wechat

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

12
Report