MySql导入数据报错Incorrect string value: '\xF0\x9F\x90\x82' for column 'content' at row 1

MySql导入数据报错Incorrect string value: '\xF0\x9F\x90\x82' for column 'content' at row 1
原因:字符集错误。
https://www.jianshu.com/p/1bee8f29a5a0
(1)修改数据库字符集

ALTER SCHEMA research CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_general_ci

(2)修改表的字符集

ALTER TABLE TABLE_NAME CONVERT TO CHARACTER SET utf8mb4

你可能感兴趣的:(MySql导入数据报错Incorrect string value: '\xF0\x9F\x90\x82' for column 'content' at row 1)