How to handle a MySQL Chinese garbled problem on the Internet

Source: Internet
Author: User

How to handle a MySQL Chinese garbled problem on the Internet
1. a friend on the Penguin asked me that the data queried by MySQL is garbled in the tool. 2. Let him check the character set settings of the mysql server. We can see that all of them are utf8 normal ,: 3. I guess it must have been a problem during data input. My friend said it was input through the source method. Then I went to the linux server and checked the imported data file: more/opt/soft/20130821ajtdrz_1. SQL: 4 then I asked him to download the file from the server and check it locally. After he downloaded the file, it showed that it was normal: 5, strange, in addition, the front-end display of the website is also good, but this situation is not uninterpretable. The text message system has had a similar experience, that is, if the entered encoding is consistent with that displayed on the front-end page, no matter what type of intermediate storage you store, even if you see garbled characters through other tools, the front-end of the web page must be displayed normally. I asked him to check whether the encoding format of the SQL file under editplus is utf8. Here, the encoding format stored by him is UTF-8, how can it become garbled in linux? 6. Let's see the language format [root @ ay13080711045157425fz soft] # echo $ LANG in linux.
En_US.UTF-8 saw here I inferred 2 reasons 1 is not zh_US.UTF-8 pattern. Is the SQL File Uploaded to linux garbled due to Chinese installation failure? 2. The stored SQL file format is incorrect. (But my friend said that the storage format is correct, this may not be very likely) 7, I googled a lot of information, found that if the en_US.UTF-8 language mode, can be normal display of Chinese characters as long, the encoding mode of the uploaded SQL file is utf8 in linux. At this point, I can determine that there is a high probability that a friend has uploaded the SQL file. I asked him to send the file to me easily. I checked his SQL file here. As a result, this brother did not reply. It is estimated that something is important to go away. 8. One and a half hours later, the brother came back and said to me, "Sorry. Back to you so late. I just went back and solved the problem. It was my file encoding problem. I saved it as utf8 and uploaded it .", Send a picture to me as follows: Summary: Chinese display garbled, probably have such a few aspects 1 server side string settings, generally unified for the utf-82 client Side string settings, check whether the encoding mode of the data uploaded by utf83 is the same as that of the server.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.