Several reasons for MySQL garbled

Source: Internet
Author: User

The reason why MySQL is garbled is that there are several reasons:

1, stored in the database before the garbled

2, stored in the database process garbled

3, stored in the database after garbled

Want to know where the garbled is very simple, in the background to print a bit to know.

Now that you know where the problem is, the solution is simple:

1, JSP set code is UTF-8, to ensure that the background is UTF-8 encoding

2. Add this section of Jdbc:mysql://localhost:3306/test to the database connection? Useunicode=true&characterencoding=utf-8, ensure that the transmission process is utf-8.

3, set the database encoding for Utf-8, in the My.ini settings or in config set also line, note is My.ini default-character-set to change two places

4, URL or Easyui garbled, you can try to server.xml Tomcat in the

<connector port= "8080" protocol= "http/1.1"               connectiontimeout= "20000"               redirectport= "8443"/>

Switch

<connector port= "8080" protocol= "http/1.1"               connectiontimeout= "20000"               redirectport= "8443" URIEncoding= " Utf-8 "/>

To ensure that not garbled, the first thing to do is to unify the code, other problems are easy to find out. Finish.

Several reasons for MySQL garbled

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.