Resolution: illegal mix of collations (utf8_general_ci,coercible) and (latin1_swedish_ci,implicit)

Source: Internet
Author: User

Reference blog:

http://mayue85.blog.163.com/blog/static/553886092010317111348552/

There was a problem connecting the database with the Java EE: illegal mix of collations (utf8_general_ci,coercible) and (latin1_swedish_ci,implicit)

The error means that there are two sets of characters in the result set.

Anyway, it means that some two places have different encoding formats, so you have to set them up to solve the problem.

My goal is to set all the properties to UTF8.

To view the MySQL character set settings:

SHOW VARIABLES like ' character_set_% ';
SHOW VARIABLES like ' collation_% ';

Change the character set settings all to UTF8:

Set Character_set_database =utf8;
Set Character_set_results =utf8;
Set Character_set_server =utf8;
Set Character_set_system =utf8;
SET Collation_server = Utf8_general_ci
SET collation_database = Utf8_general_ci

To display the encoding properties for each column of the table:

Show full columns from Table_user;

To modify the encoding properties of a table:

ALTER TABLE Table_user convert to character set UTF8;

Resolution: illegal mix of collations (utf8_general_ci,coercible) and (latin1_swedish_ci,implicit)

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.