How to crack MySQL Chinese display problems

Source: Internet
Author: User

The following articles mainly describe how to solve the problem of MySQL Chinese display. The problem of MySQL Chinese display has always been a nightmare for colleagues in actual operations, the following article provides the actual cracking solutions for MySQL Chinese display problems.

I have been working on MySQL Chinese display problems for the last two days. It is quite depressing.

Test Platform: struts1.2 + myeclipse5.5 + hibernate + MySQL5.1

The test results today are:

When the default Character Set of MySQL is set as follows, show variables ;)

 
 
  1. character_set_client | utf8  
  2. character_set_connection | utf8  
  3. character_set_database | utf8  
  4. character_set_filesystem | binary  
  5. character_set_results | utf8  
  6. character_set_server | utf8  
  7. character_set_system | utf8  
  8. character_sets_dir | C:\MySQL-5.1.6\share\charsets\ 

The content of the my. ini file is as follows:

 
 
  1. [MySQLd]  
  2. basedir=C:/MySQL-5.1.6  
  3. datadir=C:/MySQL-5.1.6/data  
  4. default-character-set=utf8 
  5. [client]  
  6. port=3306 
  7. [MySQL]  
  8. default-character-set=utf8 
  9. [WinMySQLadmin]  
  10. Server=C:/MySQL-5.1.6/bin/MySQLd-nt.exe  

Or in the MySQL Chinese display issue

Set the content of the my. ini file:

 
 
  1. [MySQLd]  
  2. basedir=C:/MySQL-5.1.6  
  3. datadir=C:/MySQL-5.1.6/data  
  4. default-character-set=gbk 
  5. [client]  
  6. port=3306 
  7. [MySQL]  
  8. default-character-set=gbk 
  9. [WinMySQLadmin]  
  10. Server=C:/MySQL-5.1.6/bin/MySQLd-nt.exe  

The url configuration of hibernate is as follows:

 
 
  1. <property name="connection.url"> 
  2. jdbc:MySQL://localhost:3306/test  
  3. </property> 

The above content is an introduction to the MySQL Chinese display problem. I hope you will get something better.

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.