Inserting the Chinese times to MySQL wrong incorrect string value: ' \xe6\x9b\xb9\xe5\x86\xac ... ' for col ....

Source: Internet
Author: User

Incorrect string value: ' \xe6\x9b\xb9\xe5\x86\xac ... ' for column ' Realname ' at row 1

This situation is typically caused by a coding error at the time of the database design.

Show variables like ' character% ' to view the database encoding for latin1.

    

If the data is not important when the project is being tested, the solution is to change the encoding format of the database using the alert database tuanplus character set UTF8 , and then re -build the table.

Note: In hibernate, specify hibernate.hbm2ddl.auto=create, redeploy the project, and hibernate will automatically re-build the table.

If the data in the project is important data, use the ALTER TABLE address convert to character set UTF8 convert the data table encoding for the Chinese character to UTF8 (the data table in this example is address):

    

To avoid improper operation, it is best to back up the data first.

Backup is a good habit, isn't it, *~*?

  

Memento.

Inserting the Chinese times to MySQL wrong incorrect string value: ' \xe6\x9b\xb9\xe5\x86\xac ... ' for col ....

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.