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

What if the mysql database cannot enter Chinese?

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

Share

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

This article mainly shows you the "mysql database can not input Chinese how to do", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "mysql database can not input Chinese" this article.

In mysql, you can modify the contents of the "my.ini" file to solve the problem that you cannot enter Chinese. Open the "my.ini" file in the mysql directory, change the content of the "default-character-set" item, and change the content of the item to "utf8".

The operating environment of this tutorial: windows10 system, mysql8.0.22 version, Dell G3 computer.

How to solve the problem that mysql can't input Chinese?

Step 1: find the directory where mysql is installed and find the my.ini file

Step 2: open the my.ini file using notepad

Find this place to see if default-character-set is utf8 or not, just change it to utf8! (it would be nice to add this sentence directly without it in previous versions! )

Step 3: enter: show variables like'%char%' in mysql database cmd

Check the encoding format of the database! The picture is displayed here. It will be shown later that the picture is changed!

Step 4: change the coding mode of the original database:

Step 5: the changed coding method:

Step 6: try inserting Chinese data! Ok! It can be plugged in!

Step 7: solve the garbled code shown in the first picture when solving select * from table

Change the coding mode above! Set character_set_results=gbk; can be displayed normally!

(3) the above has introduced the solution in detail!

But we need to note that sometimes when we add data, we still have to follow the way of "step 4" and "step 7" to solve the problem of input and display garbled!

It is worth noting that when we use myeclipse, the DBBrowser provided will not be garbled!

The above is all the contents of the article "what to do if you can't input Chinese in mysql database". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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