Mysql1366 error solution


When doing experiments, I get an error when inserting data. I see the error message "Incorrect string value". If the string value is wrong, I naturally think that the character set does not match and I get an error.
View character set:

SHOW FULL COLUMNS FROM customer;

Or: You can see it by right-clicking to change the table.

Change the encoding to utf-8:

Change the character set to utf-8 directly in the change table, and check to change it to utf8_unicode_ci.
Or enter the code to modify:

alter table 表名 change 列名 列名 varchar(20) character set utf8 collate utf8_unicode_ci not null default '';

Guess you like

Origin blog.csdn.net/qq_52605986/article/details/117037712