When MySql inserts data, it appears: Incorrect string value: '\xE6\x9F\xB3\xE5\xB2\xA9...' for column 'name' at row 1

1. When inserting data after creating the table, the following is displayed:

Incorrect string value: ‘\xE6\x9F\xB3\xE5\xB2\xA9…’ for column ‘name’ at row 1
Insert image description here

2. Reason for the error: The default character set of the name column is not UTF-8, but latin1. Just change the character set to UTF-8.

Insert image description here

Insert image description here

3. Solution (use navicat to solve):

Find the corresponding table, right-click "Design Table". Select the column and change the character set to "utf8".
Insert image description here

After saving, rerun the sql statement. Data can be inserted normally.

Guess you like

Origin blog.csdn.net/weixin_54514751/article/details/127916855