MySQL Error-prone solution (similar to \xf0\x9f\x98\x86\xf0\x9f)

Source: Internet
Author: User

Before I thought that MySQL set Utf-8 and nickname Decode after everything, the results only recently found that the 4-byte expression will be an error.

The error message is as follows:

Data:null
message:  " ### Error updating database. Cause: java.sql.SQLException:  incorrect string value:  ' \xf0\x9f\x98\x86\xf0\x9f '  for column  ' nickname '  at row 1 ### The error may involve  Com.smallfoxdog.demo.mapper.usermapper.insertuser-inline ### the error occurred while  setting parameters ### sql: insert into users (Id,wxOpenid,nickName, Avatarurl,gender,province,city,country,continue_days)  values (NULL,?,?,?,?,?,?,?, 1)  ### cause:  java.sql.SQLException: Incorrect string value:  ' \xf0\x9f\x98\x86\xf0\x9f '   for column  ' nickname '  at row 1 ; uncategorized sqlexception; sql  state [HY000]; error code [1366]; Incorrect string value:  ' \xf0\ x9f\x98\x86\xf0\x9f '  for column  ' nicknAme '  at row 1; nested exception is java.sql.sqlexception: incorrect  string value:  ' \xf0\x9f\x98\x86\xf0\x9f '  for column  ' nickname '  at  Row 1 "
status:200
timestamp:1526283581431
__proto__: Object
errmsg: "Request:ok"
Header:object

Solution: 52627223 (Note: He has 2 SQL I failed to execute, but it changed as well)

but look at other posts said the database connection time to remove the encoding format, my link address is as follows, removed the Characterencoding=utf8, Test success

Here is the effect of the modified game has been able to display the expression of the normal

MySQL Error-prone solution (similar to \xf0\x9f\x98\x86\xf0\x9f)

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.